[Issue 13474] 32 bit DMD optimizer FP arithmetic bug

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


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

--- Comment #6 from Илья Ярошенко <ilyayaroshenko at gmail.com> ---
F foo(F)(F c, F d) {
    c += d;
    c += d;
    return c;
}

void test1() {
    alias F = double;
    enum F d = (cast(F)(2)) ^^ (F.max_exp - 1);
    assert(foo(-d, d) == d);
}

--


More information about the Digitalmars-d-bugs mailing list