diff options
author | Andreas Jaeger <aj@suse.de> | 2001-08-08 16:17:56 +0000 |
---|---|---|
committer | Andreas Jaeger <aj@suse.de> | 2001-08-08 16:17:56 +0000 |
commit | bfc4cf5a1756e694dcacce8637ea6eab8d362739 (patch) | |
tree | 20325fd03ada86e1d5722dc7385b934919e1829e /sysdeps | |
parent | b412350783d865d2e988ae9effa3249d4d3906b0 (diff) | |
download | glibc-bfc4cf5a1756e694dcacce8637ea6eab8d362739.tar.gz |
(__ilogbl): Fix test for infinity.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/ieee754/ldbl-96/s_ilogbl.c | 10 |
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 9688f5af8f..6b781011c7 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) |