X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmath%2Fmodfl.c;fp=src%2Fmath%2Fmodfl.c;h=6520a1c2baab5f8435bfc570908eb8c2c7082bc3;hb=75483499dad38b97f5dabb710635e6a8bbbb1c84;hp=2ca67b118bfd1a045a437014609d1d26278be84e;hpb=2786c7d21611b9fa3b2fe356542cf213e7dd0ba4;p=musl diff --git a/src/math/modfl.c b/src/math/modfl.c index 2ca67b11..6520a1c2 100644 --- a/src/math/modfl.c +++ b/src/math/modfl.c @@ -54,7 +54,7 @@ long double modfl(long double x, long double *iptr) /* The number of fraction bits in manh, not counting the integer bit */ #define HIBITS (LDBL_MANT_DIG - LDBL_MANL_SIZE) -static const long double zero[] = { 0.0L, -0.0L }; +static const long double zero[] = { 0.0, -0.0 }; long double modfl(long double x, long double *iptr) { @@ -81,7 +81,7 @@ long double modfl(long double x, long double *iptr) return x - ux.e; } else if (e >= LDBL_MANT_DIG - 1) { /* x has no fraction part. */ *iptr = x; - if (x != x) /* Handle NaNs. */ + if (e == LDBL_MAX_EXP && (ux.bits.manh|ux.bits.manl)) /* nan */ return x; return zero[ux.bits.sign]; } else { /* Fraction part is in manl. */