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

Walter Bright <bugzi...@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #1 from Walter Bright <bugzi...@digitalmars.com> ---
What's happening here is the conversion of ulong.max to double is done by the
x87. The computed value is cached in the x87, rather than rounded to double,
and reused. Hence, it is different than when stored to an intermediary double
and reloaded.

This does not occur on 64 bit targets because those do the calculation in 64
bit XMM registers, not the 80 bit x87 registers.

The compiler could force a round-to-64 after all operations by writing to
memory and then reloading it, but this would be execrably and unacceptably
slow. When you need and can afford the load/store, use:

https://dlang.org/phobos/core_math.html#.toPrec

wontfix

--

Reply via email to