update from main archive 961113
[glibc/history.git] / sysdeps / libm-ieee754 / s_isinf.c
blobb35fc1c41c5321362ff66aa07e60d0973e575b9c
1 /*
2 * Written by J.T. Conklin <jtc@netbsd.org>.
3 * Public domain.
4 */
6 #if defined(LIBM_SCCS) && !defined(lint)
7 static char rcsid[] = "$NetBSD: s_isinf.c,v 1.3 1995/05/11 23:20:14 jtc Exp $";
8 #endif
11 * isinf(x) returns 1 is x is inf, else 0;
12 * no branching!
15 #include "math.h"
16 #include "math_private.h"
18 #ifdef __STDC__
19 int __isinf(double x)
20 #else
21 int __isinf(x)
22 double x;
23 #endif
25 int32_t hx,lx;
26 EXTRACT_WORDS(hx,lx,x);
27 hx &= 0x7fffffff;
28 hx ^= 0x7ff00000;
29 hx |= lx;
30 return (hx == 0);
32 weak_alias (__isinf, isinf)
33 #ifdef NO_LONG_DOUBLE
34 strong_alias (__isinf, __isinfl)
35 weak_alias (__isinf, isinfl)
36 #endif