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.

124 lines
3.8 KiB

  1. /* xmath.h internal header for Microsoft C */
  2. #ifndef _XMATH
  3. #define _XMATH
  4. #include <errno.h>
  5. #include <math.h>
  6. #include <stddef.h>
  7. #ifndef _YMATH
  8. #include <ymath.h>
  9. #endif
  10. _STD_BEGIN
  11. /* FLOAT PROPERTIES */
  12. #define _DBIAS 0x3fe
  13. #define _DOFF 4
  14. #define _FBIAS 0x7e
  15. #define _FOFF 7
  16. #define _FRND 1
  17. #define _D0 3 /* little-endian, small long doubles */
  18. #define _D1 2
  19. #define _D2 1
  20. #define _D3 0
  21. #define _DLONG 0
  22. #define _LBIAS 0x3fe
  23. #define _LOFF 4
  24. /* IEEE 754 double properties */
  25. #define _DFRAC ((unsigned short)((1 << _DOFF) - 1))
  26. #define _DMASK ((unsigned short)(0x7fff & ~_DFRAC))
  27. #define _DMAX ((unsigned short)((1 << (15 - _DOFF)) - 1))
  28. #define _DSIGN ((unsigned short)0x8000)
  29. #define DSIGN(x) (((unsigned short *)&(x))[_D0] & _DSIGN)
  30. #define HUGE_EXP (int)(_DMAX * 900L / 1000)
  31. #define HUGE_RAD 2.73e9 /* ~ 2^33 / pi */
  32. #define SAFE_EXP ((unsigned short)(_DMAX >> 1))
  33. /* IEEE 754 float properties */
  34. #define _FFRAC ((unsigned short)((1 << _FOFF) - 1))
  35. #define _FMASK ((unsigned short)(0x7fff & ~_FFRAC))
  36. #define _FMAX ((unsigned short)((1 << (15 - _FOFF)) - 1))
  37. #define _FSIGN ((unsigned short)0x8000)
  38. #define FSIGN(x) (((unsigned short *)&(x))[_F0] & _FSIGN)
  39. #define FHUGE_EXP (int)(_FMAX * 900L / 1000)
  40. #define FHUGE_RAD 31.8 /* ~ 2^10 / pi */
  41. #define FSAFE_EXP ((unsigned short)(_FMAX >> 1))
  42. #define _F0 1 /* little-endian order */
  43. #define _F1 0
  44. /* IEEE 754 long double properties */
  45. #define _LFRAC ((unsigned short)(-1))
  46. #define _LMASK ((unsigned short)0x7fff)
  47. #define _LMAX ((unsigned short)0x7fff)
  48. #define _LSIGN ((unsigned short)0x8000)
  49. #define LSIGN(x) (((unsigned short *)&(x))[_L0] & _LSIGN)
  50. #define LHUGE_EXP (int)(_LMAX * 900L / 1000)
  51. #define LHUGE_RAD 2.73e9 /* ~ 2^33 / pi */
  52. #define LSAFE_EXP ((unsigned short)(_LMAX >> 1))
  53. #define _L0 3 /* little-endian, small long doubles */
  54. #define _L1 2
  55. #define _L2 1
  56. #define _L3 0
  57. #define _L4 xxx
  58. /* return values for testing functions */
  59. #define FINITE _FINITE
  60. #define INF _INFCODE
  61. #define NAN _NANCODE
  62. /* return values for _Stopfx/_Stoflt */
  63. #define FL_ERR 0
  64. #define FL_DEC 1
  65. #define FL_HEX 2
  66. #define FL_INF 3
  67. #define FL_NAN 4
  68. #define FL_NEG 8
  69. _C_LIB_DECL
  70. /* double declarations */
  71. _CRTIMP2 double __cdecl _Atan(double, int);
  72. _CRTIMP2 short __cdecl _Dint(double *, short);
  73. _CRTIMP2 short __cdecl _Dnorm(unsigned short *);
  74. _CRTIMP2 short __cdecl _Dscale(double *, long);
  75. _CRTIMP2 double __cdecl _Dtento(double, long);
  76. _CRTIMP2 short __cdecl _Dunscale(short *, double *);
  77. _CRTIMP2 double __cdecl _Poly(double, const double *, int);
  78. _CRTIMP2 int __cdecl _Stoflt(const char *, char **, long[], int);
  79. extern _CRTIMP2 const _Dconst _Eps, _Rteps;
  80. extern _CRTIMP2 const double _Xbig;
  81. /* float declarations */
  82. _CRTIMP2 float __cdecl _FAtan(float, int);
  83. _CRTIMP2 short __cdecl _FDint(float *, short);
  84. _CRTIMP2 short __cdecl _FDnorm(unsigned short *);
  85. _CRTIMP2 short __cdecl _FDscale(float *, long);
  86. _CRTIMP2 float __cdecl _FDtento(float, long);
  87. _CRTIMP2 short __cdecl _FDunscale(short *, float *);
  88. _CRTIMP2 float __cdecl _FPoly(float, const float *, int);
  89. extern _CRTIMP2 const _Dconst _FEps, _FRteps;
  90. extern _CRTIMP2 const float _FXbig;
  91. /* long double functions */
  92. _CRTIMP2 long double __cdecl _LAtan(long double, int);
  93. _CRTIMP2 short __cdecl _LDint(long double *, short);
  94. _CRTIMP2 short __cdecl _LDnorm(unsigned short *);
  95. _CRTIMP2 short __cdecl _LDscale(long double *, long);
  96. _CRTIMP2 long double __cdecl _LDtento(long double, long);
  97. _CRTIMP2 short __cdecl _LDunscale(short *, long double *);
  98. _CRTIMP2 long double __cdecl _LPoly(long double, const long double *, int);
  99. extern _CRTIMP2 const _Dconst _LEps, _LRteps;
  100. extern _CRTIMP2 const long double _LXbig;
  101. _END_C_LIB_DECL
  102. _STD_END
  103. #endif /* _XMATH */
  104. /*
  105. * Copyright (c) 1992-2001 by P.J. Plauger. ALL RIGHTS RESERVED.
  106. * Consult your license regarding permissions and restrictions.
  107. V3.10:0009 */