|
|
|
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 |
|
|
11 |
|
_C_STD_BEGIN |
12 |
|
|
13 |
|
/* FLOAT PROPERTIES */ |
14 |
|
#define _DBIAS 0x3fe |
15 |
|
#define _DOFF 4 |
16 |
|
#define _FBIAS 0x7e |
17 |
|
#define _FOFF 7 |
18 |
|
#define _FRND 1 |
19 |
|
|
20 |
|
#define _D0 3 /* little-endian, small long doubles */ |
21 |
|
#define _D1 2 |
22 |
|
#define _D2 1 |
23 |
|
#define _D3 0 |
24 |
|
#define _DLONG 0 |
25 |
|
#define _LBIAS 0x3fe |
26 |
|
#define _LOFF 4 |
27 |
|
|
28 |
|
/* IEEE 754 double properties */ |
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) |
45 |
|
#define FHUGE_RAD 31.8 /* ~ 2^10 / pi */ |
46 |
|
#define FSAFE_EXP ((unsigned short)(_FMAX >> 1)) |
47 |
|
|
48 |
|
#define _F0 1 /* little-endian order */ |
49 |
|
#define _F1 0 |
50 |
|
|
51 |
|
/* IEEE 754 long double properties */ |
52 |
|
#define _LFRAC ((unsigned short)(-1)) |
53 |
|
#define _LMASK ((unsigned short)0x7fff) |
54 |
|
#define _LMAX ((unsigned short)0x7fff) |
55 |
|
#define _LSIGN ((unsigned short)0x8000) |
56 |
|
#define LSIGN(x) (((unsigned short *)&(x))[_L0] & _LSIGN) |
57 |
|
#define LHUGE_EXP (int)(_LMAX * 900L / 1000) |
58 |
|
#define LHUGE_RAD 2.73e9 /* ~ 2^33 / pi */ |
59 |
|
#define LSAFE_EXP ((unsigned short)(_LMAX >> 1)) |
60 |
|
|
61 |
|
#define _L0 3 /* little-endian, small long doubles */ |
62 |
|
#define _L1 2 |
63 |
|
#define _L2 1 |
64 |
|
#define _L3 0 |
65 |
|
#define _L4 xxx |
66 |
|
|
67 |
|
/* return values for testing functions */ |
68 |
|
#define FINITE _FINITE |
69 |
|
#define INF _INFCODE |
70 |
|
#define NAN _NANCODE |
71 |
|
|
72 |
|
#ifndef _M_CEE_PURE |
73 |
|
_C_LIB_DECL |
74 |
|
#endif |
75 |
|
|
76 |
|
/* double declarations */ |
77 |
|
_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _Dnorm(unsigned short *); |
78 |
|
_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _Dscale(double *, long); |
79 |
|
_CRTIMP2_PURE double __CLRCALL_PURE_OR_CDECL _Poly(double, const double *, int); |
80 |
|
|
81 |
|
extern _CRTIMP2_PURE /* const */ _Dconst _Eps, _Rteps; |
82 |
|
extern _CRTIMP2_PURE /* const */ double _Xbig; |
83 |
|
|
84 |
|
/* float declarations */ |
85 |
|
_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _FDnorm(unsigned short *); |
86 |
|
_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _FDscale(float *, long); |
87 |
|
|
88 |
|
extern _CRTIMP2_PURE /* const */ _Dconst _FEps, _FRteps; |
89 |
|
extern _CRTIMP2_PURE /* const */ float _FXbig; |
90 |
|
|
91 |
|
/* long double functions */ |
92 |
|
_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _LDnorm(unsigned short *); |
93 |
|
_CRTIMP2_PURE short __CLRCALL_PURE_OR_CDECL _LDscale(long double *, long); |
94 |
|
_CRTIMP2_PURE long double __CLRCALL_PURE_OR_CDECL _LPoly(long double, const long double *, int); |
95 |
|
|
96 |
|
extern _CRTIMP2_PURE /* const */ _Dconst _LEps, _LRteps; |
97 |
|
extern _CRTIMP2_PURE /* const */ long double _LXbig; |
98 |
|
#ifndef _M_CEE_PURE |
99 |
|
_END_C_LIB_DECL |
100 |
|
#endif |
101 |
|
_C_STD_END |
102 |
|
#endif /* _XMATH */ |
103 |
|
|
104 |
|
/* |
105 |
|
* Copyright (c) 1992-2007 by P.J. Plauger. ALL RIGHTS RESERVED. |
106 |
|
* Consult your license regarding permissions and restrictions. |
107 |
|
V5.03:0009 */ |
108 |
|
|
|
|
|