Skip to content

Commit f02b106

Browse files
authored
Merge pull request #5084 from kinke/patch-1
[Trivial] Fix std.conv unittest compile error for double-precision reals
2 parents c07c3ce + 52d291f commit f02b106

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

std/conv.d

Lines changed: 6 additions & 3 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
{
@@ -3032,7 +3035,7 @@ Target parse(Target, Source)(ref Source source)
30323035
}
30333036

30343037
//Tests for the double implementation
3035-
@safe unittest
3038+
unittest
30363039
{
30373040
static if (real.mant_dig == 53)
30383041
{

0 commit comments

Comments
 (0)