Printing shortest decimal form of floating point number with Mir

Walter Bright newshound2 at digitalmars.com
Mon Jan 4 05:58:09 UTC 2021


On 1/3/2021 8:37 PM, 9il wrote:
> I didn't believe it when I got a similar answer about IEEE floating-point numbers: 
> D doesn't pertinent to be IEEE 754 compatible language and the extended 
> precision bug is declared to be a language feature.

The "extended precision bug" is how all x87 code works, C to C++ to Java. The 
reason is simple - to remove the problem requires all intermediate results to be 
written to memory and read back in, which is a terrible performance problem. 
Early Java implementations did this write/read, and were forced to change it.

The advent of the XMM registers resolved this issue, and all the x86 D compilers 
now use XMM for 32 and 64 bit floating point math, when compiled for a CPU that 
has XMM registers. Extended precision only happens when the `real` 80 bit type 
is used, and that is IEEE conformant.

If you are aware of an FP bug in the XMM code generation, please file an issue 
on bugzilla, and I'll be happy to take care of it. The SIMD buglist is now down 
to one issue (32 byte stack alignment) which is something else.

The conversion to and from strings is a different problem.


More information about the Digitalmars-d-announce mailing list