From bfc4cf5a1756e694dcacce8637ea6eab8d362739 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Wed, 8 Aug 2001 16:17:56 +0000 Subject: (__ilogbl): Fix test for infinity. --- sysdeps/ieee754/ldbl-96/s_ilogbl.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sysdeps/ieee754') 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) -- cgit v1.1