diff options
author | nsz <nsz@port70.net> | 2012-03-28 23:51:09 +0200 |
---|---|---|
committer | nsz <nsz@port70.net> | 2012-03-28 23:51:09 +0200 |
commit | 9f58d06007818c43b9504e959ef81ab5f113b374 (patch) | |
tree | db76553f9a68ff7b7ec7d3415da364d48956a0c8 /src | |
parent | cf682072ce16080ebe199e5055f686d81c8416ce (diff) | |
download | musl-9f58d06007818c43b9504e959ef81ab5f113b374.tar.gz musl-9f58d06007818c43b9504e959ef81ab5f113b374.tar.bz2 musl-9f58d06007818c43b9504e959ef81ab5f113b374.tar.xz musl-9f58d06007818c43b9504e959ef81ab5f113b374.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/math/modfl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/math/modfl.c b/src/math/modfl.c index 6520a1c2..f6d62444 100644 --- a/src/math/modfl.c +++ b/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. */ |