aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2001-08-08 16:17:56 +0000
committerAndreas Jaeger <aj@suse.de>2001-08-08 16:17:56 +0000
commitbfc4cf5a1756e694dcacce8637ea6eab8d362739 (patch)
tree20325fd03ada86e1d5722dc7385b934919e1829e
parentb412350783d865d2e988ae9effa3249d4d3906b0 (diff)
downloadglibc-bfc4cf5a1756e694dcacce8637ea6eab8d362739.zip
glibc-bfc4cf5a1756e694dcacce8637ea6eab8d362739.tar.gz
glibc-bfc4cf5a1756e694dcacce8637ea6eab8d362739.tar.bz2
(__ilogbl): Fix test for infinity.
-rw-r--r--sysdeps/ieee754/ldbl-96/s_ilogbl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sysdeps/ieee754/ldbl-96/s_ilogbl.c b/sysdeps/ieee754/ldbl-96/s_ilogbl.c
index 9688f5a..6b78101 100644
--- a/sysdeps/ieee754/ldbl-96/s_ilogbl.c
+++ b/sysdeps/ieee754/ldbl-96/s_ilogbl.c
@@ -53,9 +53,13 @@ static char rcsid[] = "$NetBSD: $";
return ix;
}
else if (es<0x7fff) return es-0x3fff;
- else if (FP_ILOGBNAN != INT_MAX && (hx|lx) == 0)
- /* ISO C99 requires ilogbl(+-Inf) == INT_MAX. */
- return INT_MAX;
+ else if (FP_ILOGBNAN != INT_MAX)
+ {
+ GET_LDOUBLE_WORDS(es,hx,lx,x);
+ if ((hx & 0x7fffffff|lx) == 0)
+ /* ISO C99 requires ilogbl(+-Inf) == INT_MAX. */
+ return INT_MAX;
+ }
return FP_ILOGBNAN;
}
weak_alias (__ilogbl, ilogbl)