www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20963] New: wrong code for cast(double)anUlong

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

          Issue ID: 20963
           Summary: wrong code for cast(double)anUlong
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ilyayaroshenko gmail.com

Test case:
```
void main() {
    import std.stdio;
    ulong v = 0xE3251BACB112CB8B;
    assert(cast(double)v == 0x1.c64a375962259p+63);
    writefln("%a", cast(double)v); //0x1.c64a37596225ap+63
}
```

This is a DMD specific issue.

--
Jun 20