www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13499] New: float.compare and double.compare functions

https://issues.dlang.org/show_bug.cgi?id=13499

          Issue ID: 13499
           Summary: float.compare and double.compare functions improperly
                    compare nan
           Product: D
           Version: D2
          Hardware: x86
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: schveiguy yahoo.com

void main()
{
    float a, b=1;
    assert(!(a < b));
    assert(typeid(float).compare(&a, &b) < 0);
}

The two asserts are contradicting. compare should return -1 only if a < b.

Related to issue 13420.

--
Sep 19 2014