[Issue 13013] Failed unittests in std.json - does not parse doubles correctly

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jun 30 13:31:46 PDT 2014


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

David Nadlinger <code at klickverbot.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code at klickverbot.at

--- Comment #1 from David Nadlinger <code at klickverbot.at> ---
When porting LDC to Windows, I had to deal with a large number of such issues
that manifested in a similar way (absurd floating point results). The root
cause always was that the MSVC runtime does not support reals ("long double" in
C land, i.e. x87 80 bit floats) at all. This leads to situations where D code
is calling a function (say snprintf) with some floating point arguments on the
x87 stack, but the called function reads them from the XMM registers or the
regular stack.

If I remember correctly, DMD also uses 80 bit reals on Win64. This can't work
unless it comes with its own string formatting/math/etc. routines. For
LDC/MinGW, we just use the MinGW ones which do properly support long doubles,
but I'm not sure what the intended solution for DMD is.

--


More information about the Digitalmars-d-bugs mailing list