Leaked source code of windows server 2003
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.

28 lines
678 B

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