xref: /inferno-os/libmath/fdlibm/s_finite.c (revision 37da2899f40661e3e9631e497da8dc59b971cbd0)
1 /* derived from /netlib/fdlibm */
2 
3 /* @(#)s_finite.c 1.3 95/01/18 */
4 /*
5  * ====================================================
6  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
7  *
8  * Developed at SunSoft, a Sun Microsystems, Inc. business.
9  * Permission to use, copy, modify, and distribute this
10  * software is freely granted, provided that this notice
11  * is preserved.
12  * ====================================================
13  */
14 
15 /*
16  * finite(x) returns 1 is x is finite, else 0;
17  * no branching!
18  */
19 
20 #include "fdlibm.h"
21 
finite(double x)22 	int finite(double x)
23 {
24 	int hx;
25 	hx = __HI(x);
26 	return  (unsigned)((hx&0x7fffffff)-0x7ff00000)>>31;
27 }
28