X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fmodfl.c;h=a47b1924f75d1125b712e3ccf5b0f39af27fd8f2;hb=d055e6a45a17673b8dd3ec16e786bb2fe1700dd5;hp=4b03a4be0aa462b915c9ad5c85144771a706fcdc;hpb=73c870ed3209b68b5c8c350534508cc9d95a6bcb;p=musl diff --git a/src/math/modfl.c b/src/math/modfl.c index 4b03a4be..a47b1924 100644 --- a/src/math/modfl.c +++ b/src/math/modfl.c @@ -11,11 +11,9 @@ long double modfl(long double x, long double *iptr) return r; } #elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 -#if LDBL_MANT_DIG == 64 -#define TOINT 0x1p63 -#elif LDBL_MANT_DIG == 113 -#define TOINT 0x1p112 -#endif + +static const long double toint = 1/LDBL_EPSILON; + long double modfl(long double x, long double *iptr) { union ldshape u = {x}; @@ -40,7 +38,7 @@ long double modfl(long double x, long double *iptr) /* raises spurious inexact */ absx = s ? -x : x; - y = absx + TOINT - TOINT - absx; + y = absx + toint - toint - absx; if (y == 0) { *iptr = x; return s ? -0.0 : 0.0;