[Issue 13474] 32 bit DMD optimizer FP arithmetic bug

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Feb 8 00:05:18 PST 2015


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

yebblies <yebblies at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies at gmail.com

--- Comment #5 from yebblies <yebblies at gmail.com> ---
Reduced:

double change(double x) { return x * 10000; }

void main()
{
    double c = 0x1.388p+13;
    double s = 0x1.652efdc6018a2p+345;

    double t = s + 10000;
    c += s - t + 10000;
    s = t;

    auto x = change(-1e100);
    double u = s + x;
    c += x - u + s;
    s = u;

    assert(s + c == 20000);
}

--


More information about the Digitalmars-d-bugs mailing list