diff options
Diffstat (limited to 'sysdeps/ieee754/ldbl-96/s_floorl.c')
-rw-r--r-- | sysdeps/ieee754/ldbl-96/s_floorl.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sysdeps/ieee754/ldbl-96/s_floorl.c b/sysdeps/ieee754/ldbl-96/s_floorl.c index fb0c37e801..7115dbad9b 100644 --- a/sysdeps/ieee754/ldbl-96/s_floorl.c +++ b/sysdeps/ieee754/ldbl-96/s_floorl.c @@ -60,8 +60,13 @@ static long double huge = 1.0e4930; if(((i0&i)|i1)==0) return x; /* x is integral */ if(huge+x>0.0) { /* raise inexact flag */ if(sx) { - if (j0>0) i0 += (0x80000000)>>j0; - else ++se; + if (j0>0 && (i0+(0x80000000>>j0))>i0) + i0 += (0x80000000)>>j0; + else + { + i = 0x7fffffff; + ++se; + } } i0 &= (~i); i1=0; } |