[Issue 5999] New: Inconsistent equality with array of NaNs between runtime and CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat May 14 07:37:29 PDT 2011


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

           Summary: Inconsistent equality with array of NaNs between
                    runtime and CTFE
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Keywords: wrong-code
          Severity: minor
          Priority: P2
         Component: druntime
        AssignedTo: nobody at puremagic.com
        ReportedBy: kennytm at gmail.com


--- Comment #0 from kennytm at gmail.com 2011-05-14 07:33:25 PDT ---
In CTFE, an array of NaN will not be equal to itself. However, this return
'true' in the runtime:

-----------------------------------------------
bool f() {
    float[] h = [float.nan];
    float[] i = [float.nan];
    return h == i;
}
void main() {
    static assert(!f());    // ctfe is OK
    assert(!f());           // runtime asserts
}
-----------------------------------------------

The CTFE and runtime result should be consistent.

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