1
0

__fpclassifyf.c 254 B

1234567891011
  1. #include <math.h>
  2. #include <stdint.h>
  3. int __fpclassifyf(float x)
  4. {
  5. union {float f; uint32_t i;} u = {x};
  6. int e = u.i>>23 & 0xff;
  7. if (!e) return u.i<<1 ? FP_SUBNORMAL : FP_ZERO;
  8. if (e==0xff) return u.i<<9 ? FP_NAN : FP_INFINITE;
  9. return FP_NORMAL;
  10. }