xmath.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef _XMATH
  7. #define _XMATH
  8. #include <errno.h>
  9. #include <math.h>
  10. #include <stddef.h>
  11. #include <ymath.h>
  12. _C_STD_BEGIN
  13. #define _DBIAS 0x3fe
  14. #define _DOFF 4
  15. #define _FBIAS 0x7e
  16. #define _FOFF 7
  17. #define _FRND 1
  18. #define _D0 3
  19. #define _D1 2
  20. #define _D2 1
  21. #define _D3 0
  22. #define _DLONG 0
  23. #define _LBIAS 0x3fe
  24. #define _LOFF 4
  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
  32. #define SAFE_EXP ((unsigned short)(_DMAX >> 1))
  33. #define _FFRAC ((unsigned short)((1 << _FOFF) - 1))
  34. #define _FMASK ((unsigned short)(0x7fff & ~_FFRAC))
  35. #define _FMAX ((unsigned short)((1 << (15 - _FOFF)) - 1))
  36. #define _FSIGN ((unsigned short)0x8000)
  37. #define FSIGN(x) (((unsigned short *)&(x))[_F0] & _FSIGN)
  38. #define FHUGE_EXP (int)(_FMAX *900L / 1000)
  39. #define FHUGE_RAD 31.8
  40. #define FSAFE_EXP ((unsigned short)(_FMAX >> 1))
  41. #define _F0 1
  42. #define _F1 0
  43. #define _LFRAC ((unsigned short)(-1))
  44. #define _LMASK ((unsigned short)0x7fff)
  45. #define _LMAX ((unsigned short)0x7fff)
  46. #define _LSIGN ((unsigned short)0x8000)
  47. #define LSIGN(x) (((unsigned short *)&(x))[_L0] & _LSIGN)
  48. #define LHUGE_EXP (int)(_LMAX *900L / 1000)
  49. #define LHUGE_RAD 2.73e9
  50. #define LSAFE_EXP ((unsigned short)(_LMAX >> 1))
  51. #define _L0 3
  52. #define _L1 2
  53. #define _L2 1
  54. #define _L3 0
  55. #define _L4 xxx
  56. #define FINITE _FINITE
  57. #define INF _INFCODE
  58. #define NAN _NANCODE
  59. #define FL_ERR 0
  60. #define FL_DEC 1
  61. #define FL_HEX 2
  62. #define FL_INF 3
  63. #define FL_NAN 4
  64. #define FL_NEG 8
  65. _C_LIB_DECL
  66. _CRTIMP int __cdecl _Stopfx(const char **,char **);
  67. _CRTIMP int __cdecl _Stoflt(const char *,const char *,char **,long[],int);
  68. _CRTIMP int __cdecl _Stoxflt(const char *,const char *,char **,long[],int);
  69. _CRTIMP int __cdecl _WStopfx(const wchar_t **,wchar_t **);
  70. _CRTIMP int __cdecl _WStoflt(const wchar_t *,const wchar_t *,wchar_t **,long[],int);
  71. _CRTIMP int __cdecl _WStoxflt(const wchar_t *,const wchar_t *,wchar_t **,long[],int);
  72. _CRTIMP short __cdecl _Dnorm(unsigned short *);
  73. _CRTIMP short __cdecl _Dscale(double *,long);
  74. _CRTIMP short __cdecl _Dunscale(short *,double *);
  75. _CRTIMP double __cdecl _Poly(double,const double *,int);
  76. extern __declspec(dllimport) _Dconst _Eps,_Rteps;
  77. extern __declspec(dllimport) double _Xbig;
  78. _CRTIMP short __cdecl _FDnorm(unsigned short *);
  79. _CRTIMP short __cdecl _FDscale(float *,long);
  80. _CRTIMP short __cdecl _FDunscale(short *,float *);
  81. extern __declspec(dllimport) _Dconst _FEps,_FRteps;
  82. extern __declspec(dllimport) float _FXbig;
  83. _CRTIMP short __cdecl _LDnorm(unsigned short *);
  84. _CRTIMP short __cdecl _LDscale(long double *,long);
  85. _CRTIMP short __cdecl _LDunscale(short *,long double *);
  86. _CRTIMP long double __cdecl _LPoly(long double,const long double *,int);
  87. extern __declspec(dllimport) _Dconst _LEps,_LRteps;
  88. extern __declspec(dllimport) long double _LXbig;
  89. _END_C_LIB_DECL
  90. _C_STD_END
  91. #endif