www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20953] New: Unexpected CTFE double literals behavior

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

          Issue ID: 20953
           Summary: Unexpected CTFE double literals behavior
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ilyayaroshenko gmail.com

The issue description depends on Issue
https://issues.dlang.org/show_bug.cgi?id=20951

Pass:
auto d = 1.448997445238699;
assert(d == 0x1.72f17f1f49aaep+0);

Failed:
assert(1.448997445238699 == 0x1.72f17f1f49aaep+0);

Please note, that for both cases the valid literal value is NOT
0x1.72f17f1f49aaep+0 but 0x1.72f17f1f49aadp+0, see also the Issue 20951.

Probably the last assert uses real to parse the literal, which isn't correct
because it is a double literal.

--
Jun 18 2020