[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Pnet-developers] Formatting of System.Decimal
From: |
Marcus |
Subject: |
Re: [Pnet-developers] Formatting of System.Decimal |
Date: |
Thu, 17 Mar 2005 23:17:20 -0600 |
User-agent: |
KMail/1.8 |
It sounds as though the current implementation handles the scale incorrectly.
The C# spec indicates that the scale would be preserved in general (11.1.6)
and then describes how it should be handled for each operation in section
14.7. For example, with multiplication, the scale of the product is the sum
of the scales (before rounding).
On Thursday 17 March 2005 7:58 pm, Rhys Weatherley wrote:
> The current pnet code normalizes the decimal point position after every
> operation (pnet/support/decimal.c). I suppose it would be possible to
> modify the normalization operation to preserve trailing zeros if the result
> will still fit in the 96-bit mantissa.
>
> Then some modifications may be needed to the formatting code in pnetlib to
> use the exponent to position the decimal point correctly.