[Issue 5608] New: BigInt(1)-1 problem

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 18 03:21:24 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5608

           Summary: BigInt(1)-1 problem
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2011-02-18 03:18:46 PST ---
This program prints "-0" and then the assert fires, dmd 2.052:


import std.stdio, std.bigint;
void main() {
    writeln(BigInt(1)-1);
    assert((BigInt(1)-1) == 0);
}


Output:
-0

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list