[Issue 17185] New: Error: number '0x0.0123p-1022' is not representable

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Feb 15 09:07:40 PST 2017


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

          Issue ID: 17185
           Summary: Error: number '0x0.0123p-1022' is not representable
           Product: D
           Version: D2
          Hardware: x86
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: meapineapple at gmail.com

I had a line of code including `double(0x0.0123p-1022)` which compiled fine on
Windows 7 and OSX; note that 0x0.0123p-1022 is representable as a subnormal
double. When compiling on linux with dmd v2.073.0 I received a compile error
"Error: number '0x0.0123p-1022' is not representable" - which is not correct,
because it is representable as a subnormal.

It is possible to write `double(0x0.0123p-1022L)` instead as a workaround.

Parsing subnormal reals e.g. 0x0.0123p-16382L seems to work fine on all three
platforms.

--


More information about the Digitalmars-d-bugs mailing list