diff options
author | Martin Jambor <mjambor@suse.cz> | 2017-07-31 14:43:24 +0200 |
---|---|---|
committer | Martin Jambor <mjambor@suse.cz> | 2017-07-31 14:43:24 +0200 |
commit | b32f12dece884f1fa0f04c643a77105aff6ce8bc (patch) | |
tree | cdab5f10806561fc198f907299b0e55eb5701ef0 /libquadmath/math/logq.c | |
parent | 166bec868d991fdf71f9a66f994e5977fcab4aa2 (diff) | |
parent | a168a775e93ec31ae743ad282d8e60fa1c116891 (diff) | |
download | gcc-gcn.tar.gz |
Merge branch 'master' into gcngcn
Diffstat (limited to 'libquadmath/math/logq.c')
-rw-r--r-- | libquadmath/math/logq.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libquadmath/math/logq.c b/libquadmath/math/logq.c index 7aae9b101ad..43249bb498a 100644 --- a/libquadmath/math/logq.c +++ b/libquadmath/math/logq.c @@ -212,9 +212,8 @@ logq (__float128 x) } /* Extract exponent and reduce domain to 0.703125 <= u < 1.40625 */ - e = (int) (m >> 16) - (int) 0x3ffe; - m &= 0xffff; - u.words32.w0 = m | 0x3ffe0000; + u.value = frexpq (x, &e); + m = u.words32.w0 & 0xffff; m |= 0x10000; /* Find lookup table index k from high order bits of the significand. */ if (m < 0x16800) @@ -241,6 +240,8 @@ logq (__float128 x) /* On this interval the table is not used due to cancellation error. */ if ((x <= 1.0078125Q) && (x >= 0.9921875Q)) { + if (x == 1.0Q) + return 0.0Q; z = x - 1.0Q; k = 64; t.value = 1.0Q; |