diff options
author | Szabolcs Nagy <nsz@port70.net> | 2013-09-02 00:38:51 +0000 |
---|---|---|
committer | Szabolcs Nagy <nsz@port70.net> | 2013-09-05 11:30:07 +0000 |
commit | af5f6d9556441487e5c66a7a4cfeddf4ed354aa7 (patch) | |
tree | 34a31a68753c2851628109713a3462cb4742ef44 /src/math/ilogbl.c | |
parent | ff4d6020d1c8aaab4f05e561789d6dad3d7ef083 (diff) | |
download | musl-af5f6d9556441487e5c66a7a4cfeddf4ed354aa7.tar.gz musl-af5f6d9556441487e5c66a7a4cfeddf4ed354aa7.tar.bz2 musl-af5f6d9556441487e5c66a7a4cfeddf4ed354aa7.tar.xz musl-af5f6d9556441487e5c66a7a4cfeddf4ed354aa7.zip |
long double cleanup, initial commit
new ldshape union, ld128 support is kept, code that used the old
ldshape union was rewritten (IEEEl2bits union of freebsd libm is
not touched yet)
ld80 __fpclassifyl no longer tries to handle invalid representation
Diffstat (limited to 'src/math/ilogbl.c')
-rw-r--r-- | src/math/ilogbl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/math/ilogbl.c b/src/math/ilogbl.c index 1512934f..7df6eb6c 100644 --- a/src/math/ilogbl.c +++ b/src/math/ilogbl.c @@ -10,12 +10,12 @@ int ilogbl(long double x) int ilogbl(long double x) { union ldshape u = {x}; - uint64_t m = u.bits.m; - int e = u.bits.exp; + uint64_t m = u.i.m; + int e = u.i.se & 0x7fff; if (!e) { if (m == 0) { - FORCE_EVAL(0/0.0f); + FORCE_EVAL(x/x); return FP_ILOGB0; } /* subnormal x */ @@ -25,7 +25,7 @@ int ilogbl(long double x) if (e == 0x7fff) { FORCE_EVAL(0/0.0f); /* in ld80 msb is set in inf */ - return m & (uint64_t)-1>>1 ? FP_ILOGBNAN : INT_MAX; + return m << 1 ? FP_ILOGBNAN : INT_MAX; } return e - 0x3fff; } |