diff options
author | Adhemerval Zanella <azanella@linux.vnet.ibm.com> | 2012-06-05 10:13:41 -0300 |
---|---|---|
committer | Adhemerval Zanella <azanella@linux.vnet.ibm.com> | 2012-06-05 10:16:49 -0300 |
commit | 34ae0b3270c67cae0c54ac98b693fdf7d010a206 (patch) | |
tree | 6ddad70ab157b943232a254477fe07ec96445331 /sysdeps/ieee754/ldbl-128ibm/math_ldbl.h | |
parent | 1214ec8f4c2e8fd105a6d9159b85cf31c0c6c386 (diff) | |
download | glibc-34ae0b3270c67cae0c54ac98b693fdf7d010a206.zip glibc-34ae0b3270c67cae0c54ac98b693fdf7d010a206.tar.gz glibc-34ae0b3270c67cae0c54ac98b693fdf7d010a206.tar.bz2 |
Fix ldbl128ibm fmodl for subnormals.
Diffstat (limited to 'sysdeps/ieee754/ldbl-128ibm/math_ldbl.h')
-rw-r--r-- | sysdeps/ieee754/ldbl-128ibm/math_ldbl.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h b/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h index d055d65..be9ac71 100644 --- a/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h +++ b/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h @@ -6,20 +6,20 @@ #include <ieee754.h> static inline void -ldbl_extract_mantissa (int64_t *hi64, u_int64_t *lo64, int *exp, long double x) +ldbl_extract_mantissa (int64_t *hi64, uint64_t *lo64, int *exp, long double x) { /* We have 105 bits of mantissa plus one implicit digit. Since 106 bits are representable we use the first implicit digit for the number before the decimal point and the second implicit bit as bit 53 of the mantissa. */ - unsigned long long hi, lo; + uint64_t hi, lo; int ediff; union ibm_extended_long_double eldbl; eldbl.d = x; *exp = eldbl.ieee.exponent - IBM_EXTENDED_LONG_DOUBLE_BIAS; - lo = ((long long)eldbl.ieee.mantissa2 << 32) | eldbl.ieee.mantissa3; - hi = ((long long)eldbl.ieee.mantissa0 << 32) | eldbl.ieee.mantissa1; + lo = ((int64_t)eldbl.ieee.mantissa2 << 32) | eldbl.ieee.mantissa3; + hi = ((int64_t)eldbl.ieee.mantissa0 << 32) | eldbl.ieee.mantissa1; /* If the lower double is not a denomal or zero then set the hidden 53rd bit. */ if (eldbl.ieee.exponent2 > 0x001) @@ -31,8 +31,8 @@ ldbl_extract_mantissa (int64_t *hi64, u_int64_t *lo64, int *exp, long double x) ediff = eldbl.ieee.exponent - eldbl.ieee.exponent2; if (ediff > 53) lo = lo >> (ediff-53); + hi |= (1ULL << 52); } - hi |= (1ULL << 52); if ((eldbl.ieee.negative != eldbl.ieee.negative2) && ((eldbl.ieee.exponent2 != 0) && (lo != 0LL))) |