1 /*
2 Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
3 
4 Developed at SunPro, a Sun Microsystems, Inc. business.
5 Permission to use, copy, modify, and distribute this
6 software is freely granted, provided that this notice
7 is preserved.
8  */
9 /*
10  * isinff(x) returns 1 if x is +-infinity, else 0;
11  *
12  * isinf is a <math.h> macro in the C99 standard.  It was previously
13  * implemented as isinf and isinff functions by newlib and are still declared
14  * as such in <math.h>.  Newlib supplies it here as a function if the user
15  * chooses to use it instead of the C99 macro.
16  */
17 
18 #define _ADD_D_TO_DOUBLE_FUNCS
19 
20 #include "fdlibm.h"
21 #include <ieeefp.h>
22 
23 #undef isinff
24 
25 int
isinff(float x)26 isinff (float x)
27 {
28 	__int32_t ix;
29 	GET_FLOAT_WORD(ix,x);
30 	ix &= 0x7fffffff;
31 	return FLT_UWORD_IS_INFINITE(ix);
32 }
33 
34 #undef isinf
35 
36 _MATH_ALIAS_i_f(isinf)
37 #ifdef _DOUBLE_IS_32BITS
38 #define isinfd __isinfd
39 _MATH_ALIAS_i_d_to_f(isinf)
40 #endif
41