diff options
author | Andreas Jaeger <aj@suse.de> | 2001-07-23 13:23:30 +0000 |
---|---|---|
committer | Andreas Jaeger <aj@suse.de> | 2001-07-23 13:23:30 +0000 |
commit | bdce812bdb61b8817dda4d0991e41ca5a2a36885 (patch) | |
tree | 5e0e36060272993fe36af65730754cb9fca79322 | |
parent | dacbc9832b21e75ff8e652cf1bab69711ba1ddd1 (diff) | |
download | glibc-bdce812bdb61b8817dda4d0991e41ca5a2a36885.zip glibc-bdce812bdb61b8817dda4d0991e41ca5a2a36885.tar.gz glibc-bdce812bdb61b8817dda4d0991e41ca5a2a36885.tar.bz2 |
Update.
2001-07-23 Stephen L Moshier <moshier@mediaone.net>
* sysdeps/ieee754/ldbl-128/s_log1pl.c (__log1pl): Return proper
sign for 0 input and set divide by zero exception for -1 input.
Return argument if NaN or infinity.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128/s_log1pl.c | 22 |
2 files changed, 17 insertions, 11 deletions
@@ -1,3 +1,9 @@ +2001-07-23 Stephen L Moshier <moshier@mediaone.net> + + * sysdeps/ieee754/ldbl-128/s_log1pl.c (__log1pl): Return proper + sign for 0 input and set divide by zero exception for -1 input. + Return argument if NaN or infinity. + 2001-07-23 Andreas Jaeger <aj@suse.de> * sysdeps/sparc/sparc64/fpu/libm-test-ulps: Add some deltas. diff --git a/sysdeps/ieee754/ldbl-128/s_log1pl.c b/sysdeps/ieee754/ldbl-128/s_log1pl.c index fcb6ecc..c19bea8 100644 --- a/sysdeps/ieee754/ldbl-128/s_log1pl.c +++ b/sysdeps/ieee754/ldbl-128/s_log1pl.c @@ -120,23 +120,23 @@ __log1pl (long double xm1) int32_t ix; int e; - x = xm1 + 1.0L; - - /* Test for domain errors. */ - if (x > maxlog) - return (big * big); - - /* Test for NaN input. */ + /* Test for NaN or infinity input. */ u.value = xm1; ix = u.parts32.w0 & 0x7fffffff; - if ((ix >= 0x7fff0000) - && (((ix & 0xffff) | u.parts32.w1 | u.parts32.w2 | u.parts32.w3) != 0)) - return x; + if (ix >= 0x7fff0000) + return xm1; + + /* log1p(+- 0) = +- 0. */ + if ((ix == 0) && (u.parts32.w1 | u.parts32.w2 | u.parts32.w3) == 0) + return xm1; + + x = xm1 + 1.0L; + /* log1p(-1) = -inf */ if (x <= 0.0L) { if (x == 0.0L) - return (-big * big); + return (-1.0L / zero); else return (zero / zero); } |