[Issue 21698] New: Windows VisualD x86-mscoff fails to compare double.infinity

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 10 14:57:00 UTC 2021


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

          Issue ID: 21698
           Summary: Windows VisualD x86-mscoff fails to compare
                    double.infinity
           Product: D
           Version: D2
          Hardware: Other
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: bugzilla at bernis-buecher.de

The following unittest fails on dlang.phobos (Windows_VisualD x86-mscoff) from
the Phobos testsuite:

unittest
{
    import std.math : pow;

    double d1 = 21800.0;
    assert(pow(d1,72) == double.infinity); // fails

    // additional infos:

    import std.stdio;
    writeln(pow(d1,72)); // inf
    writeln(typeof(pow(d1,72)).stringof); // double

    union A
    {
        double a;
        ulong b;
    }

    A a;
    a.a = pow(d1,72);
    writefln!"%.064b"(a.b); //
0111111111110000000000000000000000000000000000000000000000000000
}

The output at the bottom shows, that value, type and even bitpattern are
correct. Anyway, the comparison fails. (It works on all other computers from
the test suite.)

--


More information about the Digitalmars-d-bugs mailing list