06c404f5ead3f80d9d401b97bfbeb8189ba0d7d8
1 #include <crtdll/float.h>
2 #include <crtdll/math.h>
3 #include <crtdll/internal/ieee.h>
5 #define _FPCLASS_SNAN 0x0001 /* signaling NaN */
6 #define _FPCLASS_QNAN 0x0002 /* quiet NaN */
7 #define _FPCLASS_NINF 0x0004 /* negative infinity */
8 #define _FPCLASS_NN 0x0008 /* negative normal */
9 #define _FPCLASS_ND 0x0010 /* negative denormal */
10 #define _FPCLASS_NZ 0x0020 /* -0 */
11 #define _FPCLASS_PZ 0x0040 /* +0 */
12 #define _FPCLASS_PD 0x0080 /* positive denormal */
13 #define _FPCLASS_PN 0x0100 /* positive normal */
14 #define _FPCLASS_PINF 0x0200 /* positive infinity */
16 #define FP_SNAN 0x0001 // signaling NaN
17 #define FP_QNAN 0x0002 // quiet NaN
18 #define FP_NINF 0x0004 // negative infinity
19 #define FP_PINF 0x0200 // positive infinity
20 #define FP_NDENORM 0x0008 // negative denormalized non-zero
21 #define FP_PDENORM 0x0010 // positive denormalized non-zero
22 #define FP_NZERO 0x0020 // negative zero
23 #define FP_PZERO 0x0040 // positive zero
24 #define FP_NNORM 0x0080 // negative normalized non-zero
25 #define FP_PNORM 0x0100 // positive normalized non-zero
27 typedef int fpclass_t
;
29 fpclass_t
_fpclass(double __d
)
31 double_t
*d
= (double_t
*)&__d
;
33 if ( d
->exponent
== 0 ) {
34 if ( d
->mantissah
== 0 && d
->mantissal
== 0 ) {
46 if (d
->exponent
== 0x7ff ) {
47 if ( d
->mantissah
== 0 && d
->mantissal
== 0 ) {
53 else if ( d
->mantissah
== 0 && d
->mantissal
!= 0 ) {
56 else if ( d
->mantissah
== 0 && d
->mantissal
!= 0 ) {