2.9
[glibc/nacl-glibc.git] / sysdeps / ieee754 / ldbl-96 / s_isinfl.c
blob9583234efa93750101003e50d234902cf9628ed7
1 /*
2 * Written by J.T. Conklin <jtc@netbsd.org>.
3 * Change for long double by Ulrich Drepper <drepper@cygnus.com>.
4 * Public domain.
5 */
7 #if defined(LIBM_SCCS) && !defined(lint)
8 static char rcsid[] = "$NetBSD: $";
9 #endif
12 * isinfl(x) returns 1 if x is inf, -1 if x is -inf, else 0;
13 * no branching!
16 #include "math.h"
17 #include "math_private.h"
19 int
20 __isinfl (long double x)
22 int32_t se,hx,lx;
23 GET_LDOUBLE_WORDS(se,hx,lx,x);
24 lx |= (hx & 0x7fffffff) | ((se & 0x7fff) ^ 0x7fff);
25 lx |= -lx;
26 se &= 0x8000;
27 return ~(lx >> 31) & (1 - (se >> 14));
29 hidden_def (__isinfl)
30 weak_alias (__isinfl, isinfl)