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