xref: /netbsd-src/lib/libm/src/s_isinff.c (revision 76dfffe33547c37f8bdd446e3e4ab0f3c16cea4b)
1 /*
2  * Written by J.T. Conklin <jtc@netbsd.org>.
3  * Public domain.
4  */
5 
6 #if defined(LIBM_SCCS) && !defined(lint)
7 static char rcsid[] = "$NetBSD: s_isinff.c,v 1.3 1995/05/11 23:03:44 jtc Exp $";
8 #endif
9 
10 /*
11  * isinff(x) returns 1 is x is inf, else 0;
12  * no branching!
13  */
14 
15 #include "math.h"
16 #include "math_private.h"
17 
18 #ifdef __STDC__
19 	int isinff(float x)
20 #else
21 	int isinff(x)
22 	float x;
23 #endif
24 {
25 	int32_t ix;
26 	GET_FLOAT_WORD(ix,x);
27 	ix &= 0x7fffffff;
28 	ix ^= 0x7f800000;
29 	return (ix == 0);
30 }
31