[Issue 13474] 32 bit DMD optimizer FP arithmetic bug

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Feb 8 01:19:45 PST 2015


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

--- Comment #7 from yebblies <yebblies at gmail.com> ---
change(-1e100) calculates its result at real precision, then returns it in
ST(0).  It is duplicated via the stack (truncating to double) but the full
precision value is then added with (1e104) and due to the extra precision they
no longer cancel exactly, instead resulting in -1.3987216024025249e+0087.

This value causes the later addition 10000 to be ignored, leading to the wrong
result and the assertion failure.

So, is it invalid to return a double in ST0 without first truncating it to
double precision?

--


More information about the Digitalmars-d-bugs mailing list