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.)
Comment #1 by robert.schadek — 2024-12-13T19:15:07Z