[Issue 4988] New: Floats in structs are not equal on 0.0f vs -0.0f

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 4 01:34:50 PDT 2010


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

           Summary: Floats in structs are not equal on 0.0f vs -0.0f
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: simen.kjaras at gmail.com


--- Comment #0 from Simen Kjaeraas <simen.kjaras at gmail.com> 2010-10-04 01:34:30 PDT ---
The following code asserts:

struct Foo {
    float data;
}

void bug( ) {
    assert( Foo( 0.0f ) == Foo( -0.0f ) ); // Works fine
    auto a = Foo( 0.0f );
    auto b = Foo( -0.0f );
    assert( b == a ); // Asserts
}

-- 
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