www.digitalmars.com         C & C++   DMDScript  

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


          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 puremagic.com
          Reporter: meapineapple 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

Feb 15 2017