Skip to content

Commit 9091b8f

Browse files
committed
fixup
1 parent dee91b2 commit 9091b8f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

source/mir/bignum/internal/dec2float.d

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,26 +140,27 @@ T decimalToFloatImpl(T)(ulong coefficient, long exponent)
140140
if (_expect(-ExponentM <= exponent && exponent <= ExponentM, true))
141141
{
142142
auto c = coefficient.Fp!64;
143+
T approx = void;
143144
version (all)
144145
{{
145146
auto z = c.extendedMul!true(_load!wordBits(exponent));
146-
auto approx = z.opCast!(T, true);
147+
approx = z.opCast!(T, true);
147148
long bitsDiff = (cast(ulong) z.opCast!(Fp!wordBits).coefficient & mask) - half;
148149
uint slop = 3 * (exponent < 0);
149150
if (_expect(approx > T.min_normal && (bitsDiff < 0 ? -bitsDiff : bitsDiff) > slop, true))
150151
return approx;
151152
}}
152153
static if (T.mant_dig < 64)
153-
{
154+
{{
154155
auto z = c.extendedMul!true(_load!128(exponent));
155-
auto approx = z.opCast!(T, true);
156+
approx = z.opCast!(T, true);
156157
auto bitsDiff = (z.opCast!(Fp!128).coefficient & bigMask) - bigHalf;
157158
if (bitsDiff.signBit)
158159
bitsDiff = UInt!128.init - bitsDiff;
159160
uint slop = 3 * (exponent < 0);
160161
if (_expect(approx > T.min_normal && bitsDiff > slop, true))
161162
return approx;
162-
}
163+
}}
163164

164165
if (0 <= exponent)
165166
{

0 commit comments

Comments
 (0)