Browse Source

math: fix modfl.c bug
modfl(+-inf) was wrong on ld80 because the explicit msb
was not taken into account during inf vs nan check

nsz 13 years ago
parent
commit
9f58d06007
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/math/modfl.c

+ 1 - 1
src/math/modfl.c

@@ -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 (e == LDBL_MAX_EXP && (ux.bits.manh|ux.bits.manl)) /* nan */
+		if (e == LDBL_MAX_EXP && ((ux.bits.manh&~LDBL_NBIT)|ux.bits.manl)) /* nan */
 			return x;
 		return zero[ux.bits.sign];
 	} else {                                /* Fraction part is in manl. */