diff options
author | Ulrich Drepper <drepper@redhat.com> | 1997-03-17 04:06:58 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1997-03-17 04:06:58 +0000 |
commit | 9b5225b600d1943bf66ee53ae4dd0e636117a394 (patch) | |
tree | ea5246ad10fe906103dae081c38666b06e5acf88 | |
parent | f13f1b26e4985b12e3c4bfaae80c65e3839579c2 (diff) | |
download | glibc-9b5225b600d1943bf66ee53ae4dd0e636117a394.tar.gz |
Return -1 for -inf.
-rw-r--r-- | sysdeps/libm-i387/s_isinfl.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sysdeps/libm-i387/s_isinfl.c b/sysdeps/libm-i387/s_isinfl.c index 3ee53d5ecc..f07898fd1b 100644 --- a/sysdeps/libm-i387/s_isinfl.c +++ b/sysdeps/libm-i387/s_isinfl.c @@ -10,7 +10,7 @@ static char rcsid[] = "$NetBSD: $"; #endif /* - * isinfl(x) returns 1 is x is inf, else 0; + * isinfl(x) returns 1 if x is inf, -1 if x is -inf, else 0; * no branching! */ @@ -26,11 +26,11 @@ static char rcsid[] = "$NetBSD: $"; { int32_t se,hx,lx; GET_LDOUBLE_WORDS(se,hx,lx,x); - se &= 0x7fff; - se ^= 0x7fff; /* This additional ^ 0x80000000 is necessary because in Intel's - internal representation the implicit one is explicit. */ - se |= (hx ^ 0x80000000) | lx; - return (se == 0); + internal representation of the implicit one is explicit. */ + lx |= (hx ^ 0x80000000) | ((se & 0x7fff) ^ 0x7fff); + lx |= -lx; + se &= 0x8000; + return ~(lx >> 31) & (1 - (se >> 14)); } weak_alias (__isinfl, isinfl) |