aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2001-07-23 08:54:31 +0000
committerAndreas Jaeger <aj@suse.de>2001-07-23 08:54:31 +0000
commit514abd20feb847b3d2b0816f634a471c3c82c632 (patch)
tree3d15c38655fcbdafe21387ae7319776caeee97b5 /sysdeps
parent1a9cbbbf75b04e39f56f932a0b27f6173ba5dd43 (diff)
downloadglibc-514abd20feb847b3d2b0816f634a471c3c82c632.tar
glibc-514abd20feb847b3d2b0816f634a471c3c82c632.tar.gz
glibc-514abd20feb847b3d2b0816f634a471c3c82c632.tar.bz2
glibc-514abd20feb847b3d2b0816f634a471c3c82c632.zip
Update.
2001-07-23 Stephen L Moshier <moshier@mediaone.net> * sysdeps/ieee754/ldbl-128/s_expm1l.c (__expm1l): Return proper sign for 0 input. Return NaN with no exception for NaN input.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/ieee754/ldbl-128/s_expm1l.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/sysdeps/ieee754/ldbl-128/s_expm1l.c b/sysdeps/ieee754/ldbl-128/s_expm1l.c
index f662ee9093..c03635e2ab 100644
--- a/sysdeps/ieee754/ldbl-128/s_expm1l.c
+++ b/sysdeps/ieee754/ldbl-128/s_expm1l.c
@@ -81,14 +81,6 @@ __expm1l (long double x)
ieee854_long_double_shape_type u;
int k;
- /* Overflow. */
- if (x > maxlog)
- return (big * big);
-
- /* Minimum value. */
- if (x < minarg)
- return (4.0 / big - 1.0L);
-
/* Detect infinity and NaN. */
u.value = x;
ix = u.parts32.w0;
@@ -104,10 +96,22 @@ __expm1l (long double x)
else
return x;
}
- /* NaN. */
- return (x + x);
+ /* NaN. No invalid exception. */
+ return x;
}
+ /* expm1(+- 0) = +- 0. */
+ if ((ix == 0) && (u.parts32.w1 | u.parts32.w2 | u.parts32.w3) == 0)
+ return x;
+
+ /* Overflow. */
+ if (x > maxlog)
+ return (big * big);
+
+ /* Minimum value. */
+ if (x < minarg)
+ return (4.0/big - 1.0L);
+
/* Express x = ln 2 (k + remainder), remainder not exceeding 1/2. */
xx = C1 + C2; /* ln 2. */
px = __floorl (0.5 + x / xx);