diff options
Diffstat (limited to 'libquadmath/math/isinfq.c')
-rw-r--r-- | libquadmath/math/isinfq.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/libquadmath/math/isinfq.c b/libquadmath/math/isinfq.c index 46996b54c3d..673fd22caf8 100644 --- a/libquadmath/math/isinfq.c +++ b/libquadmath/math/isinfq.c @@ -4,14 +4,23 @@ * Public domain. */ +#if defined(LIBM_SCCS) && !defined(lint) +static char rcsid[] = "$NetBSD: $"; +#endif + +/* + * isinfq(x) returns 1 if x is inf, -1 if x is -inf, else 0; + * no branching! + */ + #include "quadmath-imp.h" int isinfq (__float128 x) { - int64_t hx,lx; - GET_FLT128_WORDS64(hx,lx,x); - lx |= (hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL; - lx |= -lx; - return ~(lx >> 63) & (hx >> 62); + int64_t hx,lx; + GET_FLT128_WORDS64(hx,lx,x); + lx |= (hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL; + lx |= -lx; + return ~(lx >> 63) & (hx >> 62); } |