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