[Issue 7546] New: 64-bit floating-point issue with negative zero: -0.0 == 0.0 is false.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 19 11:15:04 PST 2012


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

           Summary: 64-bit floating-point issue with negative zero: -0.0
                    == 0.0 is false.
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: kennytm at gmail.com


--- Comment #0 from kennytm at gmail.com 2012-02-19 11:15:03 PST ---
Test case:

----------------------
void main()
{
    auto p = -0.0;
    assert(p == 0);
}
----------------------

Running the program with -m64 caused an Assertion failure. (This works in
32-bit.)

An equivalent test which also fails in 64-bit:

----------------------
void main()
{
    double p = -0.0;
    assert(p == -0.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