dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pnet-developers] Re: [Bug #3487] Formatter.cs decimal padding passe


From: Gopal V
Subject: Re: [Pnet-developers] Re: [Bug #3487] Formatter.cs decimal padding passes negative arg to StringBuilder.Insert
Date: Wed, 7 May 2003 12:52:19 +0530
User-agent: Mutt/1.2.5i

If memory serves me right, Gopal V wrote:
> For the rest of the problem , I think we'll all need more help :-) ... The
> most exasperating thing about all this is that you can't use Console.WriteLine
> with the formatting code :-( ...

IF you're trying to debug this .... I think there's a bug in the 
ILDecimal multiplication stuff ... I mean , Decimal is supposed to
be a small range x accurate decimals type , right ?.

So here's the bug ....
                
                Console.WriteLine((123456789912345678991234567m*10.0m) == 
1234567899123456789912345670m);

                Comes out (thanks to constant folding) as 

        ldc.i4.0
        call    void ['mscorlib']'System'.'Console'::'WriteLine'(bool)


        -O0 doesnot disable constant folding ... This is what I got when I 
force-dumped it by passing to another function. Obviously we got some 
data muddled up here ....

        ldc.i4  3596737606
        ldc.i4  3932153566
        ldc.i4  66926050
        ldc.i4.0
        ldc.i4.0
        newobj  instance void [.library]System.Decimal::.ctor(int32, int32, 
int32, bool, unsigned int8)
        ldc.i4  3596737606
        ldc.i4  3932153570
        ldc.i4  66926059
        ldc.i4.0
        ldc.i4.0
        newobj  instance void [.library]System.Decimal::.ctor(int32, int32, 
int32, bool, unsigned int8)

        So somewhere in the deep recesses of pnet's support/decimal.c lurks a 
bug ... Or am I missing some checked {} or similar arithmetic crap ?.

Gopal
-- 
The difference between insanity and genius is measured by success

Attachment: FormatDecimal.cs
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]