(__ilogbl): Fix test for infinity.

This commit is contained in:
Andreas Jaeger 2001-08-08 16:17:56 +00:00
parent b412350783
commit bfc4cf5a17

View File

@ -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)
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)