Update copyright dates with scripts/update-copyrights.
[glibc.git] / sysdeps / ieee754 / dbl-64 / s_isinf.c
blob46a7266e7fa2de6f2b9b7251375a715f3171f09e
1 /*
2 * Written by J.T. Conklin <jtc@netbsd.org>.
3 * Changed to return -1 for -Inf by Ulrich Drepper <drepper@cygnus.com>.
4 * Public domain.
5 */
7 #if defined(LIBM_SCCS) && !defined(lint)
8 static char rcsid[] = "$NetBSD: s_isinf.c,v 1.3 1995/05/11 23:20:14 jtc Exp $";
9 #endif
12 * isinf(x) returns 1 is 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 __isinf (double x)
22 int32_t hx, lx;
23 EXTRACT_WORDS (hx, lx, x);
24 lx |= (hx & 0x7fffffff) ^ 0x7ff00000;
25 lx |= -lx;
26 return ~(lx >> 31) & (hx >> 30);
28 hidden_def (__isinf)
29 weak_alias (__isinf, isinf)
30 #ifdef NO_LONG_DOUBLE
31 strong_alias (__isinf, __isinfl)
32 weak_alias (__isinf, isinfl)
33 #endif