diff options
Diffstat (limited to 'sysdeps/ieee754/ldbl-128/s_roundl.c')
-rw-r--r-- | sysdeps/ieee754/ldbl-128/s_roundl.c | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/sysdeps/ieee754/ldbl-128/s_roundl.c b/sysdeps/ieee754/ldbl-128/s_roundl.c index 98b448e4f3..63ffd73d7e 100644 --- a/sysdeps/ieee754/ldbl-128/s_roundl.c +++ b/sysdeps/ieee754/ldbl-128/s_roundl.c @@ -23,9 +23,6 @@ #include <math_private.h> -static const long double huge = 1.0E4930L; - - long double __roundl (long double x) { @@ -38,13 +35,10 @@ __roundl (long double x) { if (j0 < 0) { - if (huge + x > 0.0) - { - i0 &= 0x8000000000000000ULL; - if (j0 == -1) - i0 |= 0x3fff000000000000LL; - i1 = 0; - } + i0 &= 0x8000000000000000ULL; + if (j0 == -1) + i0 |= 0x3fff000000000000LL; + i1 = 0; } else { @@ -52,13 +46,10 @@ __roundl (long double x) if (((i0 & i) | i1) == 0) /* X is integral. */ return x; - if (huge + x > 0.0) - { - /* Raise inexact if x != 0. */ - i0 += 0x0000800000000000LL >> j0; - i0 &= ~i; - i1 = 0; - } + + i0 += 0x0000800000000000LL >> j0; + i0 &= ~i; + i1 = 0; } } else if (j0 > 111) @@ -76,14 +67,10 @@ __roundl (long double x) /* X is integral. */ return x; - if (huge + x > 0.0) - { - /* Raise inexact if x != 0. */ - u_int64_t j = i1 + (1LL << (111 - j0)); - if (j < i1) - i0 += 1; - i1 = j; - } + u_int64_t j = i1 + (1LL << (111 - j0)); + if (j < i1) + i0 += 1; + i1 = j; i1 &= ~i; } |