Skip to content

Commit 4985f5e

Browse files
authored
Merge pull request #10914 from WalterBright/convOverflow
longs might be too long for doubles
2 parents a2d99d9 + b0d4040 commit 4985f5e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

std/conv.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,21 +1866,21 @@ if (!is(S : T) && isAssociativeArray!S &&
18661866
assert(convFails!(Floating, Integral, ConvOverflowException)(a));
18671867
}
18681868
// convert to the smallest integral value
1869-
a = 0.0 + Integral.min;
1869+
a = 0.0L + Integral.min;
18701870
static if (Integral.min < 0)
18711871
{
18721872
a = -a; // -Integral.min not representable as an Integral
18731873
assert(convFails!(Floating, Integral, ConvOverflowException)(a)
18741874
|| Floating.sizeof <= Integral.sizeof
18751875
|| floatTraits!Floating.realFormat == RealFormat.ieeeExtended53);
18761876
}
1877-
a = 0.0 + Integral.min;
1877+
a = 0.0L + Integral.min;
18781878
assert(to!Integral(a) == Integral.min);
18791879
--a; // no more representable as an Integral
18801880
assert(convFails!(Floating, Integral, ConvOverflowException)(a)
18811881
|| Floating.sizeof <= Integral.sizeof
18821882
|| floatTraits!Floating.realFormat == RealFormat.ieeeExtended53);
1883-
a = 0.0 + Integral.max;
1883+
a = 0.0L + Integral.max;
18841884
assert(to!Integral(a) == Integral.max
18851885
|| Floating.sizeof <= Integral.sizeof
18861886
|| floatTraits!Floating.realFormat == RealFormat.ieeeExtended53);

0 commit comments

Comments
 (0)