summaryrefslogtreecommitdiff
path: root/libm/s_scalbn.c
diff options
context:
space:
mode:
Diffstat (limited to 'libm/s_scalbn.c')
-rw-r--r--libm/s_scalbn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libm/s_scalbn.c b/libm/s_scalbn.c
index 6534fd4cf..b10bd7028 100644
--- a/libm/s_scalbn.c
+++ b/libm/s_scalbn.c
@@ -56,10 +56,11 @@ tiny = 1.0e-300;
if (k > 0x7fe) return huge*copysign(huge,x); /* overflow */
if (k > 0) /* normal result */
{SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;}
- if (k <= -54)
+ if (k <= -54) {
if (n > 50000) /* in case integer overflow in n+k */
return huge*copysign(huge,x); /*overflow*/
else return tiny*copysign(tiny,x); /*underflow*/
+ }
k += 54; /* subnormal result */
SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20));
return x*twom54;