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.

46 lines
1.3 KiB

  1. /* values used by math functions -- IEEE 754 version */
  2. #include "wctype.h"
  3. #include "xmath.h"
  4. _STD_BEGIN
  5. /* macros */
  6. #define NBITS (48 + _DOFF)
  7. #if _D0
  8. #define INIT(w0) {0, 0, 0, w0}
  9. #define INIT2(w0, w1) {w1, 0, 0, w0}
  10. #else
  11. #define INIT(w0) {w0, 0, 0, 0}
  12. #define INIT2(w0, w1) {w0, 0, 0, w1}
  13. #endif
  14. /* static data */
  15. _CRTIMP2 const _Dconst _Denorm = {INIT2(0, 1)};
  16. _CRTIMP2 const _Dconst _Eps = {INIT((_DBIAS - NBITS - 1) << _DOFF)};
  17. _CRTIMP2 const _Dconst _Hugeval = {INIT(_DMAX << _DOFF)};
  18. _CRTIMP2 const _Dconst _Inf = {INIT(_DMAX << _DOFF)};
  19. _CRTIMP2 const _Dconst _Nan = {INIT(_DSIGN | (_DMAX << _DOFF)
  20. | (1 << (_DOFF - 1)))};
  21. _CRTIMP2 const _Dconst _Rteps = {INIT((_DBIAS - NBITS / 2) << _DOFF)};
  22. _CRTIMP2 const _Dconst _Snan = {INIT(_DSIGN | (_DMAX << _DOFF))};
  23. _CRTIMP2 const double _Xbig = (NBITS + 1) * 347L / 1000;
  24. #if defined(__CENTERLINE__)
  25. #define _DYNAMIC_INIT_CONST(x) \
  26. (x._D = *(double *)(void *)(x._W))
  27. double _centerline_double_dynamic_inits =
  28. _DYNAMIC_INIT_CONST(_Hugeval),
  29. _DYNAMIC_INIT_CONST(_Eps),
  30. _DYNAMIC_INIT_CONST(_Inf),
  31. _DYNAMIC_INIT_CONST(_Nan),
  32. _DYNAMIC_INIT_CONST(_Rteps);
  33. #endif
  34. _STD_END
  35. /*
  36. * Copyright (c) 1994 by P.J. Plauger. ALL RIGHTS RESERVED.
  37. * Consult your license regarding permissions and restrictions.
  38. */
  39. /*
  40. 941029 pjp: added _STD machinery
  41. 950222 pjp: added signaling NaN, denorm minimum for C++
  42. */