__fpclassify.c 232 B

12345678910
  1. #include "libm.h"
  2. int __fpclassify(double x)
  3. {
  4. union dshape u = { x };
  5. int e = u.bits>>52 & 0x7ff;
  6. if (!e) return u.bits<<1 ? FP_SUBNORMAL : FP_ZERO;
  7. if (e==0x7ff) return u.bits<<12 ? FP_NAN : FP_INFINITE;
  8. return FP_NORMAL;
  9. }