Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
585 B

  1. /* _FDtest function -- IEEE 754 version */
  2. #include "wctype.h"
  3. #include "xmath.h"
  4. _STD_BEGIN
  5. _CRTIMP2 short _FDtest(float *px)
  6. { /* categorize *px */
  7. unsigned short *ps = (unsigned short *)px;
  8. if ((ps[_F0] & _FMASK) == _FMAX << _FOFF)
  9. return ((ps[_F0] & _FFRAC) != 0 || ps[_F1] != 0
  10. ? NAN : INF);
  11. else if ((ps[_F0] & ~_FSIGN) != 0 || ps[_F1] != 0)
  12. return (FINITE);
  13. else
  14. return (0);
  15. }
  16. _STD_END
  17. /*
  18. * Copyright (c) 1994 by P.J. Plauger. ALL RIGHTS RESERVED.
  19. * Consult your license regarding permissions and restrictions.
  20. */
  21. /*
  22. 941029 pjp: added _STD machinery
  23. */