2 * ====================================================
3 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
5 * Developed at SunPro, a Sun Microsystems, Inc. business.
6 * Permission to use, copy, modify, and distribute this
7 * software is freely granted, provided that this notice
9 * ====================================================
14 <<isnan>>, <<isnanf>>, <<isinf>>, <<isinff>>, <<finite>>, <<finitef>>---test for exceptional numbers
32 int isnan(double <[arg]>);
33 int isinf(double <[arg]>);
34 int finite(double <[arg]>);
35 int isnanf(float <[arg]>);
36 int isinff(float <[arg]>);
37 int finitef(float <[arg]>);
41 These functions provide information on the floating-point
44 There are five major number formats:
47 A number which contains all zero bits.
49 A number with a zero exponent but a nonzero fraction.
51 A number with an exponent and a fraction.
53 A number with an all 1's exponent and a zero fraction.
55 A number with an all 1's exponent and a nonzero fraction.
59 <<isnan>> returns 1 if the argument is a nan. <<isinf>>
60 returns 1 if the argument is infinity. <<finite>> returns 1 if the
61 argument is zero, subnormal or normal.
63 Note that by the C99 standard, <<isnan>> and <<isinf>> are macros
64 taking any type of floating-point and are declared in
65 <<math.h>>. Newlib has chosen to declare these both as functions
66 and as macros in <<math.h>>.
68 The <<isnanf>>, <<isinff>> and <<finitef>> functions perform the same
69 operations as their <<isnan>>, <<isinf>> and <<finite>>
70 counterparts, but on single-precision floating-point numbers.
87 * __isnand(x) returns 1 is x is nan, else 0;
93 #ifndef _DOUBLE_IS_32BITS
99 EXTRACT_WORDS(hx
,lx
,x
);
101 hx
|= (__uint32_t
)(lx
|(-lx
))>>31;
102 hx
= 0x7ff00000 - hx
;
103 return (int)(((__uint32_t
)(hx
))>>31);
106 #endif /* _DOUBLE_IS_32BITS */