diff options
Diffstat (limited to 'newlib/libm/common/s_scalbn.c')
-rw-r--r-- | newlib/libm/common/s_scalbn.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/newlib/libm/common/s_scalbn.c b/newlib/libm/common/s_scalbn.c index 245888fc8..e06767042 100644 --- a/newlib/libm/common/s_scalbn.c +++ b/newlib/libm/common/s_scalbn.c @@ -91,10 +91,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; |