Skip to content

Commit 52d291f

Browse files
committed
Fix std.conv unittest for double-precision reals
1 parent 6c9bfb2 commit 52d291f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

std/conv.d

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,8 +1624,11 @@ private void testFloatingToIntegral(Floating, Integral)()
16241624
assert(to!long(to!double(b)) == b);
16251625
assert(to!long(to!double(-b)) == -b);
16261626
// real
1627-
ulong c = 18_446_744_073_709_551_615UL; // 2^64 - 1
1628-
assert(to!ulong(to!real(c)) == c);
1627+
static if (real.mant_dig >= 64)
1628+
{
1629+
ulong c = 18_446_744_073_709_551_615UL; // 2^64 - 1
1630+
assert(to!ulong(to!real(c)) == c);
1631+
}
16291632
}
16301633
// test conversions floating => integral
16311634
{

0 commit comments

Comments
 (0)