bf59d0d4709f066ce612e6f5ac5448b1aeb2f157
[musl] / src / math / __fpclassifyf.c
1 #include <stdint.h>
2 #include <math.h>
3
4 int __fpclassifyf(float __x)
5 {
6         union {
7                 float __f;
8                 __uint32_t __i;
9         } __y = { __x };
10         int __ee = __y.__i>>23 & 0xff;
11         if (!__ee) return __y.__i<<1 ? FP_SUBNORMAL : FP_ZERO;
12         if (__ee==0xff) return __y.__i<<9 ? FP_NAN : FP_INFINITE;
13         return FP_NORMAL;
14 }