1 
2 /* @(#)s_finite.c 5.1 93/09/24 */
3 /*
4  * ====================================================
5  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6  *
7  * Developed at SunPro, a Sun Microsystems, Inc. business.
8  * Permission to use, copy, modify, and distribute this
9  * software is freely granted, provided that this notice
10  * is preserved.
11  * ====================================================
12  */
13 
14 /*
15  * finite(x) returns 1 is x is finite, else 0;
16  * no branching!
17  */
18 
19 #include "fdlibm.h"
20 
21 #ifdef _NEED_FLOAT64
22 
23 int
finite64(__float64 x)24 finite64(__float64 x)
25 {
26 	__int32_t hx;
27 	GET_HIGH_WORD(hx,x);
28 	return  (int)((__uint32_t)((hx&0x7fffffff)-0x7ff00000)>>31);
29 }
30 
31 _MATH_ALIAS_i_d(finite)
32 
33 #if defined(_HAVE_ALIAS_ATTRIBUTE)
34 #ifndef __clang__
35 #pragma GCC diagnostic ignored "-Wmissing-attributes"
36 #endif
37 __strong_reference(finite64, __finite64);
38 #else
39 
40 int __finite64(__float64 x)
41 {
42     return finite64(x);
43 }
44 
45 #endif
46 
47 _MATH_ALIAS_i_d(__finite)
48 
49 #endif /* _NEED_FLOAT64 */
50