ReactOS 0.4.17-dev-1421-g4623072
math.h
Go to the documentation of this file.
1
4#ifndef _INC_MATH
5#define _INC_MATH
6
7#include <corecrt.h>
8
9#pragma pack(push,_CRT_PACKING)
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15typedef float float_t;
16typedef double double_t;
17
18#ifndef _EXCEPTION_DEFINED
19#define _EXCEPTION_DEFINED
20 struct _exception {
21 int type;
22 char *name;
23 double arg1;
24 double arg2;
25 double retval;
26 };
27#endif
28
29#ifndef _COMPLEX_DEFINED
30#define _COMPLEX_DEFINED
31 struct _complex {
32 double x,y;
33 };
34#if !__STDC__ && !defined(__cplusplus)
35#define complex _complex
36#endif /* __STDC__ */
37#endif /* _COMPLEX_DEFINED */
38
39#define _DOMAIN 1
40#define _SING 2
41#define _OVERFLOW 3
42#define _UNDERFLOW 4
43#define _TLOSS 5
44#define _PLOSS 6
45
46#define EDOM 33
47#define ERANGE 34
48
49 _CRTIMP extern double const _HUGE;
50
51#define HUGE_VAL _HUGE
52
53#ifndef _HUGE_ENUF
54#define _HUGE_ENUF 1e+300
55#endif
56#define INFINITY ((float)(_HUGE_ENUF * _HUGE_ENUF))
57#define HUGE_VALD ((double)INFINITY)
58#define HUGE_VALF ((float)INFINITY)
59#define HUGE_VALL ((long double)INFINITY)
60#ifndef _UCRT_NEGATIVE_NAN
61// This operation creates a negative NAN adding a - to make it positive
62#ifdef _MSC_VER
63#define NAN (-(float)(INFINITY * 0.0F))
64#else
65#define NAN (__builtin_nanf(""))
66#endif
67#else
68// Keep this for backwards compatibility
69#ifdef _MSC_VER
70#define NAN ((float)(INFINITY * 0.0F))
71#else
72#define NAN (-__builtin_nanf(""))
73#endif
74#endif
75
76#define _DENORM (-2)
77#define _FINITE (-1)
78#define _INFCODE 1
79#define _NANCODE 2
80
81#define FP_INFINITE _INFCODE
82#define FP_NAN _NANCODE
83#define FP_NORMAL _FINITE
84#define FP_SUBNORMAL _DENORM
85#define FP_ZERO 0
86
87#ifndef __cplusplus
88#define _matherrl _matherr
89#endif
90
91#ifndef _CRT_ABS_DEFINED
92#define _CRT_ABS_DEFINED
95_Check_return_ long long __cdecl llabs(_In_ long long x);
96#endif
97
101_Check_return_ double __cdecl atan2(_In_ double y, _In_ double x);
106_Check_return_ double __cdecl fmod(_In_ double x, _In_ double y);
109_Check_return_ double __cdecl pow(_In_ double x, double y);
115
116#if defined(_MSC_VER) && !defined(__clang__)
117/* Prevent the compiler from generating calls to _CIatan2 */
118#pragma function(atan2)
119#ifdef _M_AMD64
120/* Prevent the compiler from generating calls to __vdecl_xxx */
121#pragma function(cos,pow,sin,tan)
122#endif
123#endif
124
125#ifndef _CRT_MATHERR_DEFINED
126#define _CRT_MATHERR_DEFINED
128#endif
129
130#ifndef _CRT_ATOF_DEFINED
131#define _CRT_ATOF_DEFINED
134#endif /* _CRT_ATOF_DEFINED */
135
136#ifndef _SIGN_DEFINED
137#define _SIGN_DEFINED
140#endif
141
155_Check_return_ _CRTIMP double __cdecl modf(_In_ double x, _Out_ double *y);
156
157#if defined(__i386__) || defined(_M_IX86)
159#endif
160
161#if defined(__x86_64) || defined(_M_AMD64)
162_Check_return_ _CRTIMP float __cdecl _nextafterf(_In_ float x, _In_ float y);
165#if defined(_MSC_VER) && !defined(__clang__)
166/* Prevent the compiler from generating calls to __vdecl_floor2 */
167#pragma function(floor)
168#endif
169#endif
170
171#if defined(__x86_64) || defined(_M_AMD64) || \
172 defined(__arm__) || defined(_M_ARM) || \
173 defined(__arm64__) || defined(_M_ARM64)
176#endif /* _M_AMD64 || _M_ARM || _M_ARM64 */
177
178#if defined(__ia64__) || defined (_M_IA64)
179_Check_return_ _CRTIMP float __cdecl ldexpf(_In_ float x, _In_ int y);
180_Check_return_ _CRTIMP long double __cdecl tanl(_In_ long double x);
181#else
182_Check_return_ __CRT_INLINE float __CRTDECL ldexpf(_In_ float x, _In_ int y) { return (float)ldexp(x, y); }
183_Check_return_ __CRT_INLINE long double __CRTDECL tanl(_In_ long double x) { return (tan((double)x)); }
184#endif
185
186#if defined(_CRTBLD)
187_Check_return_ float __cdecl fabsf(_In_ float x);
188#elif defined(__ia64__) || defined(_M_IA64) || \
189 defined(__arm__) || defined(_M_ARM) || \
190 defined(__arm64__) || defined(_M_ARM64)
192#else
193_Check_return_ __CRT_INLINE float __CRTDECL fabsf(_In_ float x) { return ((float)fabs((double)x)); }
194#endif /* _M_IA64 || _M_ARM || _M_ARM64 */
195
197_Check_return_ float __cdecl _copysignf(_In_ float x, _In_ float y);
198_Check_return_ float __cdecl _hypotf(_In_ float x, _In_ float y);
199_Check_return_ float __cdecl acosf(_In_ float x);
200_Check_return_ float __cdecl asinf(_In_ float x);
201_Check_return_ float __cdecl atanf(_In_ float x);
202_Check_return_ float __cdecl atan2f(_In_ float x, _In_ float y);
203_Check_return_ float __cdecl ceilf(_In_ float x);
204_Check_return_ float __cdecl cosf(_In_ float x);
205_Check_return_ float __cdecl coshf(_In_ float x);
206_Check_return_ float __cdecl expf(_In_ float x);
207_Check_return_ float __cdecl floorf(_In_ float x);
208_Check_return_ float __cdecl fmodf(_In_ float x, _In_ float y);
209_Check_return_ float __cdecl logf(_In_ float x);
210_Check_return_ float __cdecl log10f(_In_ float x);
211_Check_return_ float __cdecl modff(_In_ float x, _Out_ float *y);
212_Check_return_ float __cdecl powf(_In_ float b, _In_ float e);
213_Check_return_ float __cdecl sinf(_In_ float x);
214_Check_return_ float __cdecl sinhf(_In_ float x);
215_Check_return_ float __cdecl sqrtf(_In_ float x);
216_Check_return_ float __cdecl tanf(_In_ float x);
217_Check_return_ float __cdecl tanhf(_In_ float x);
218
219#if defined(_MSC_VER) && !defined(__clang__)
220/* Make sure intrinsics don't get in our way */
221#if defined(_M_AMD64) || defined(_M_ARM) || defined(_M_ARM64)
222#pragma function(acosf,asinf,atanf,atan2f,ceilf,cosf,coshf,expf,floorf,fmodf,logf,log10f,powf,sinf,sinhf,sqrtf,tanf,tanhf)
223#endif /* defined(_M_AMD64) || defined(_M_ARM) || defined(_M_ARM64) */
224#if (_MSC_VER >= 1920)
225#pragma function(_hypotf)
226#endif
227#endif /* _MSC_VER */
228
229#if !defined(_CRTBLD)
230_Check_return_ __CRT_INLINE float _chgsignf(_In_ float x) { return (float)_chgsign((double)x); }
231_Check_return_ __CRT_INLINE float _copysignf(_In_ float x, _In_ float y) { return (float)_copysign((double)x, (double)y); }
232_Check_return_ __CRT_INLINE float _hypotf(_In_ float x, _In_ float y) { return (float)_hypot((double)x, (double)y); }
233_Check_return_ __CRT_INLINE float acosf(_In_ float x) { return (float)acos((double)x); }
234_Check_return_ __CRT_INLINE float asinf(_In_ float x) { return (float)asin((double)x); }
235_Check_return_ __CRT_INLINE float atanf(_In_ float x) { return (float)atan((double)x); }
236_Check_return_ __CRT_INLINE float atan2f(_In_ float x, _In_ float y) { return (float)atan2((double)x,(double)y); }
237_Check_return_ __CRT_INLINE float ceilf(_In_ float x) { return (float)ceil((double)x); }
238_Check_return_ __CRT_INLINE float cosf(_In_ float x) { return (float)cos((double)x); }
239_Check_return_ __CRT_INLINE float coshf(_In_ float x) { return (float)cosh((double)x); }
240_Check_return_ __CRT_INLINE float expf(_In_ float x) { return (float)exp((double)x); }
241_Check_return_ __CRT_INLINE float floorf(_In_ float x) { return (float)floor((double)x); }
242_Check_return_ __CRT_INLINE float fmodf(_In_ float x, _In_ float y) { return (float)fmod((double)x,(double)y); }
243_Check_return_ __CRT_INLINE float logf(_In_ float x) { return (float)log((double)x); }
244_Check_return_ __CRT_INLINE float log10f(_In_ float x) { return (float)log10((double)x); }
245_Check_return_ __CRT_INLINE float modff(_In_ float x, _Out_ float *y) { double _Di,_Df = modf((double)x,&_Di); *y = (float)_Di; return (float)_Df; }
246_Check_return_ __CRT_INLINE float powf(_In_ float x, _In_ float y) { return (float)pow((double)x,(double)y); }
247_Check_return_ __CRT_INLINE float sinf(_In_ float x) { return (float)sin((double)x); }
248_Check_return_ __CRT_INLINE float sinhf(_In_ float x) { return (float)sinh((double)x); }
249_Check_return_ __CRT_INLINE float sqrtf(_In_ float x) { return (float)sqrt((double)x); }
250_Check_return_ __CRT_INLINE float tanf(_In_ float x) { return (float)tan((double)x); }
251_Check_return_ __CRT_INLINE float tanhf(_In_ float x) { return (float)tanh((double)x); }
252#endif /* !defined(_CRTBLD) */
253
254_Check_return_ __CRT_INLINE double hypot(_In_ double x, _In_ double y) { return _hypot(x, y); }
255_Check_return_ __CRT_INLINE float hypotf(_In_ float x, _In_ float y) { return _hypotf(x, y); }
256_Check_return_ __CRT_INLINE float frexpf(_In_ float x, _Out_ int *y) { return ((float)frexp((double)x,y)); }
257
258/* long double equals double, so just use inline wrappers */
259_Check_return_ __CRT_INLINE long double acosl(_In_ long double x) { return (acos((double)x)); }
260_Check_return_ __CRT_INLINE long double asinl(_In_ long double x) { return (asin((double)x)); }
261_Check_return_ __CRT_INLINE long double atanl(_In_ long double x) { return (atan((double)x)); }
262_Check_return_ __CRT_INLINE long double atan2l(_In_ long double y, _In_ long double x) { return (atan2((double)y, (double)x)); }
263_Check_return_ __CRT_INLINE long double ceill(_In_ long double x) { return (ceil((double)x)); }
264_Check_return_ __CRT_INLINE long double cosl(_In_ long double x) { return (cos((double)x)); }
265_Check_return_ __CRT_INLINE long double coshl(_In_ long double x) { return (cosh((double)x)); }
266_Check_return_ __CRT_INLINE long double expl(_In_ long double x) { return (exp((double)x)); }
267_Check_return_ __CRT_INLINE long double fabsl(_In_ long double x) { return fabs((double)x); }
268_Check_return_ __CRT_INLINE long double floorl(_In_ long double x) { return (floor((double)x)); }
269_Check_return_ __CRT_INLINE long double fmodl(_In_ long double x, _In_ long double y) { return (fmod((double)x, (double)y)); }
270_Check_return_ __CRT_INLINE long double frexpl(_In_ long double x, _Out_ int *y) { return (frexp((double)x, y)); }
271_Check_return_ __CRT_INLINE long double hypotl(_In_ long double x, _In_ long double y) { return _hypot((double)x, (double)y); }
272_Check_return_ __CRT_INLINE long double logl(_In_ long double x) { return (log((double)x)); }
273_Check_return_ __CRT_INLINE long double log10l(_In_ long double x) { return (log10((double)x)); }
274_Check_return_ __CRT_INLINE long double powl(_In_ long double x, _In_ long double y) { return (pow((double)x, (double)y)); }
275_Check_return_ __CRT_INLINE long double sinl(_In_ long double x) { return (sin((double)x)); }
276_Check_return_ __CRT_INLINE long double sinhl(_In_ long double x) { return (sinh((double)x)); }
277_Check_return_ __CRT_INLINE long double sqrtl(_In_ long double x) { return (sqrt((double)x)); }
278_Check_return_ __CRT_INLINE long double tanhl(_In_ long double x) {return (tanh((double)x)); }
279_Check_return_ __CRT_INLINE long double _chgsignl(_In_ long double number) { return _chgsign((double)number); }
280_Check_return_ __CRT_INLINE long double _copysignl(_In_ long double number, _In_ long double sign) { return _copysign((double)number, (double)sign); }
281_Check_return_ __CRT_INLINE long double _hypotl(_In_ long double x, _In_ long double y) { return _hypot((double)x, (double)y); }
282_Check_return_ __CRT_INLINE long double ldexpl(_In_ long double x, _In_ int y) { return ldexp((double)x, y); }
283_Check_return_ __CRT_INLINE long double modfl(_In_ long double x, _Out_ long double *y) { return (long double)modf((double)x, (double *)y); }
284
285/* Support for some functions, not exported in MSVCRT */
286#if (_MSC_VER >= 1929) && !defined(__clang__)
287_Check_return_ long lrint(_In_ double x);
288_Check_return_ long lrintf(_In_ float x);
289_Check_return_ long lrintl(_In_ long double x);
290#pragma function(lrint, lrintf, lrintl)
291#endif
292
293#ifndef _CRTBLD
294#if (_MSC_VER >= 1952) && !defined(__clang__)
295/* MSVC 14.52+ (VS 2026 18.12+) treats these as intrinsics,
296 * which cannot be defined (C2169) */
297#pragma warning(push)
298#pragma warning(disable:4163)
299_Check_return_ float copysignf(_In_ float x, _In_ float y);
300#pragma function(copysignf)
301#if defined(_M_IX86) || defined(_M_AMD64)
302_Check_return_ double fmax(_In_ double x, _In_ double y);
303_Check_return_ double fmin(_In_ double x, _In_ double y);
304_Check_return_ float fmaxf(_In_ float x, _In_ float y);
305_Check_return_ float fminf(_In_ float x, _In_ float y);
306#pragma function(fmax, fmin, fmaxf, fminf)
307#endif /* _M_IX86 || _M_AMD64 */
308#pragma warning(pop)
309#endif /* _MSC_VER >= 1952 && !__clang__ */
310_Check_return_ __CRT_INLINE double round(_In_ double x) { return (x < 0) ? ceil(x - 0.5f) : floor(x + 0.5); }
311_Check_return_ __CRT_INLINE float roundf(_In_ float x) { return (x < 0) ? ceilf(x - 0.5f) : floorf(x + 0.5); }
312_Check_return_ __CRT_INLINE long double roundl(_In_ long double x) { return (x < 0) ? ceill(x - 0.5f) : floorl(x + 0.5); }
313_Check_return_ __CRT_INLINE long lround(_In_ double x) { return (long)((x < 0) ? (x - 0.5f) : (x + 0.5)); }
314_Check_return_ __CRT_INLINE long lroundf(_In_ float x) { return (long)((x < 0) ? (x - 0.5f) : (x + 0.5)); }
315_Check_return_ __CRT_INLINE long lroundl(_In_ long double x) { return (long)((x < 0) ? (x - 0.5f) : (x + 0.5)); }
316_Check_return_ __CRT_INLINE long long llround(_In_ double x) { return (long long)((x < 0) ? (x - 0.5f) : (x + 0.5)); }
317_Check_return_ __CRT_INLINE long long llroundf(_In_ float x) { return (long long)((x < 0) ? (x - 0.5f) : (x + 0.5)); }
318_Check_return_ __CRT_INLINE long long llroundl(_In_ long double x) { return (long long)((x < 0) ? (x - 0.5f) : (x + 0.5)); }
319_Check_return_ __CRT_INLINE double rint(_In_ double x) { return round(x); }
320_Check_return_ __CRT_INLINE float rintf(_In_ float x) { return roundf(x); }
321_Check_return_ __CRT_INLINE long double rintl(_In_ long double x) { return roundl(x); }
322_Check_return_ __CRT_INLINE long lrint(_In_ double x) { return (long)((x < 0) ? (x - 0.5f) : (x + 0.5)); }
323_Check_return_ __CRT_INLINE long lrintf(_In_ float x) { return (long)((x < 0) ? (x - 0.5f) : (x + 0.5)); }
324_Check_return_ __CRT_INLINE long lrintl(_In_ long double x) { return (long)((x < 0) ? (x - 0.5f) : (x + 0.5)); }
325_Check_return_ __CRT_INLINE long long llrint(_In_ double x) { return (long long)((x < 0) ? (x - 0.5f) : (x + 0.5)); }
326_Check_return_ __CRT_INLINE long long llrintf(_In_ float x) { return (long long)((x < 0) ? (x - 0.5f) : (x + 0.5)); }
327_Check_return_ __CRT_INLINE long long llrintl(_In_ long double x) { return (long long)((x < 0) ? (x - 0.5f) : (x + 0.5)); }
328#ifdef _MSC_VER
329#define log2 _log2 // nasty hack, see CORE-18255
330#define log2f _log2f // see log2 above
331#endif
332_Check_return_ __CRT_INLINE double log2(_In_ double x) { return log(x) / log(2); }
333_Check_return_ __CRT_INLINE float log2f(_In_ float x) { return (float)(log((double)x) / log(2)); }
334_Check_return_ __CRT_INLINE float copysignf(_In_ float x, _In_ float y) { return _copysignf(x, y); }
335
336/* C99 7.12.3.2. _finite() is exported by msvcrt on every architecture,
337 unlike _finitef(), which is amd64-only. */
338#ifndef isfinite
340#define isfinite(x) (_finite((double)(x)) != 0)
341#endif
342
343/* C99 7.12.3.6 */
344#ifndef signbit
345_Check_return_ __CRT_INLINE int __cdecl __signbit(_In_ double x) { return _copysign(1.0, x) < 0.0; }
346#define signbit(x) __signbit((double)(x))
347#endif
348
349/* C99 7.12.3.4 */
351#ifndef isnan
352#define isnan(x) (_isnan((double)(x)) != 0)
353#endif
354
355/* C99 7.12.3.3 */
356#ifndef isinf
357#define isinf(x) (!_finite((double)(x)) && !_isnan((double)(x)))
358#endif
359
360/* C99 7.12.12.2/7.12.12.3. Per the standard these return the non-NaN operand
361 if exactly one argument is a NaN; note this is NOT the same as min()/max(). */
362_Check_return_ __CRT_INLINE double exp2(_In_ double x) { return pow(2.0, x); }
363_Check_return_ __CRT_INLINE float exp2f(_In_ float x) { return (float)pow(2.0, (double)x); }
364_Check_return_ __CRT_INLINE double fmax(_In_ double x, _In_ double y)
365{
366 if (_isnan(x)) return y;
367 if (_isnan(y)) return x;
368 return (x < y) ? y : x;
369}
370_Check_return_ __CRT_INLINE double fmin(_In_ double x, _In_ double y)
371{
372 if (_isnan(x)) return y;
373 if (_isnan(y)) return x;
374 return (x < y) ? x : y;
375}
376_Check_return_ __CRT_INLINE float fmaxf(_In_ float x, _In_ float y) { return (float)fmax((double)x, (double)y); }
377_Check_return_ __CRT_INLINE float fminf(_In_ float x, _In_ float y) { return (float)fmin((double)x, (double)y); }
378#endif /* !_CRTBLD */
379
380#ifndef NO_OLDNAMES /* !__STDC__ */
381
382#define DOMAIN _DOMAIN
383#define SING _SING
384#define OVERFLOW _OVERFLOW
385#define UNDERFLOW _UNDERFLOW
386#define TLOSS _TLOSS
387#define PLOSS _PLOSS
388#define matherr _matherr
389//_CRTIMP extern double HUGE;
390#define HUGE _HUGE
391//_CRT_NONSTDC_DEPRECATE(_cabs) _CRTIMP double __cdecl cabs(_In_ struct _complex x);
392#define cabs _cabs
393
400
401#endif /* NO_OLDNAMES */
402
403#ifdef __cplusplus
404}
405#ifndef _CMATH_
406extern "C++" {
407
408//inline long abs(_In_ long x) { return labs(x); }
409_Check_return_ inline double abs(_In_ double x) throw() { return fabs(x); }
410
411_Check_return_ inline float abs(_In_ float x) throw() { return fabsf(x); }
412_Check_return_ inline float acos(_In_ float x) throw() { return acosf(x); }
413_Check_return_ inline float asin(_In_ float x) throw() { return asinf(x); }
414_Check_return_ inline float atan(_In_ float x) throw() { return atanf(x); }
415_Check_return_ inline float atan2(_In_ float y, _In_ float x) throw() { return atan2f(y, x); }
416_Check_return_ inline float ceil(_In_ float x) throw() { return ceilf(x); }
417_Check_return_ inline float copysign(_In_ float x, _In_ float y) throw() { return _copysignf(x, y); }
418_Check_return_ inline float cos(_In_ float x) throw() { return cosf(x); }
419_Check_return_ inline float cosh(_In_ float x) throw() { return coshf(x); }
420_Check_return_ inline float exp(_In_ float x) throw() { return expf(x); }
421_Check_return_ inline float fabs(_In_ float x) throw() { return fabsf(x); }
422_Check_return_ inline float floor(_In_ float x) throw() { return floorf(x); }
423_Check_return_ inline float fmod(_In_ float x, _In_ float y) throw() { return fmodf(x, y); }
424_Check_return_ inline float frexp(_In_ float x, _Out_ int * y) throw() { return frexpf(x, y); }
425_Check_return_ inline float hypot(_In_ float x, _In_ float y) throw() { return _hypotf(x, y); }
426_Check_return_ inline float ldexp(_In_ float x, _In_ int y) throw() { return ldexpf(x, y); }
427_Check_return_ inline float log(_In_ float x) throw() { return logf(x); }
428_Check_return_ inline float log10(_In_ float x) throw() { return log10f(x); }
429_Check_return_ inline float modf(_In_ float x, _Out_ float * y) throw() { return modff(x, y); }
430_Check_return_ inline float pow(_In_ float x, _In_ float y) throw() { return powf(x, y); }
431_Check_return_ inline float sin(_In_ float x) throw() { return sinf(x); }
432_Check_return_ inline float sinh(_In_ float x) throw() { return sinhf(x); }
433_Check_return_ inline float sqrt(_In_ float x) throw() { return sqrtf(x); }
434_Check_return_ inline float tan(_In_ float x) throw() { return tanf(x); }
435_Check_return_ inline float tanh(_In_ float x) throw() { return tanhf(x); }
436
437_Check_return_ inline long double abs(_In_ long double x) throw() { return fabsl(x); }
438_Check_return_ inline long double acos(_In_ long double x) throw() { return acosl(x); }
439_Check_return_ inline long double asin(_In_ long double x) throw() { return asinl(x); }
440_Check_return_ inline long double atan(_In_ long double x) throw() { return atanl(x); }
441_Check_return_ inline long double atan2(_In_ long double y, _In_ long double x) throw() { return atan2l(y, x); }
442_Check_return_ inline long double ceil(_In_ long double x) throw() { return ceill(x); }
443_Check_return_ inline long double copysign(_In_ long double x, _In_ long double y) throw() { return _copysignl(x, y); }
444_Check_return_ inline long double cos(_In_ long double x) throw() { return cosl(x); }
445_Check_return_ inline long double cosh(_In_ long double x) throw() { return coshl(x); }
446_Check_return_ inline long double exp(_In_ long double x) throw() { return expl(x); }
447_Check_return_ inline long double fabs(_In_ long double x) throw() { return fabsl(x); }
448_Check_return_ inline long double floor(_In_ long double x) throw() { return floorl(x); }
449_Check_return_ inline long double fmod(_In_ long double x, _In_ long double y) throw() { return fmodl(x, y); }
450_Check_return_ inline long double frexp(_In_ long double x, _Out_ int * y) throw() { return frexpl(x, y); }
451_Check_return_ inline long double hypot(_In_ long double x, _In_ long double y) throw() { return hypotl(x, y); }
452_Check_return_ inline long double ldexp(_In_ long double x, _In_ int y) throw() { return ldexpl(x, y); }
453_Check_return_ inline long double log(_In_ long double x) throw() { return logl(x); }
454_Check_return_ inline long double log10(_In_ long double x) throw() { return log10l(x); }
455_Check_return_ inline long double modf(_In_ long double x, _Out_ long double * y) throw() { return modfl(x, y); }
456_Check_return_ inline long double pow(_In_ long double x, _In_ long double y) throw() { return powl(x, y); }
457_Check_return_ inline long double sin(_In_ long double x) throw() { return sinl(x); }
458_Check_return_ inline long double sinh(_In_ long double x) throw() { return sinhl(x); }
459_Check_return_ inline long double sqrt(_In_ long double x) throw() { return sqrtl(x); }
460_Check_return_ inline long double tan(_In_ long double x) throw() { return tanl(x); }
461_Check_return_ inline long double tanh(_In_ long double x) throw() { return tanhl(x); }
462}
463#endif /* !_CMATH_ */
464#endif /* __cplusplus */
465
466#pragma pack(pop)
467
468#endif /* !_INC_MATH */
469
470#if defined(_USE_MATH_DEFINES) && !defined(_MATH_DEFINES_DEFINED)
471#define _MATH_DEFINES_DEFINED
472
473#define M_E 2.71828182845904523536
474#define M_LOG2E 1.44269504088896340736
475#define M_LOG10E 0.434294481903251827651
476#define M_LN2 0.693147180559945309417
477#define M_LN10 2.30258509299404568402
478#define M_PI 3.14159265358979323846
479#define M_PI_2 1.57079632679489661923
480#define M_PI_4 0.785398163397448309616
481#define M_1_PI 0.318309886183790671538
482#define M_2_PI 0.636619772367581343076
483#define M_2_SQRTPI 1.12837916709551257390
484#define M_SQRT2 1.41421356237309504880
485#define M_SQRT1_2 0.707106781186547524401
486
487#endif /* _USE_MATH_DEFINES */
BYTE exp2[512/16]
Definition: bcrypt.c:2641
Definition: _locale.h:75
static float(WINAPI *pD2D1Tan)(float angle)
#define __cdecl
Definition: corecrt.h:121
_ACRTIMP int __cdecl _finite(double)
Definition: math.c:1601
_ACRTIMP double __cdecl _copysign(double, double)
Definition: copysign.c:17
_ACRTIMP float __cdecl asinf(float)
Definition: asinf.c:47
_ACRTIMP float __cdecl atanf(float)
Definition: atanf.c:47
_ACRTIMP __int64 __cdecl llrint(double)
Definition: mingw_math.h:395
_ACRTIMP float __cdecl powf(float, float)
Definition: powf.c:14
_ACRTIMP double __cdecl _yn(int, double)
Definition: jn_yn.c:21
_ACRTIMP double __cdecl log10(double)
Definition: freeldr.c:191
static double j0(double x)
Definition: math.h:421
_ACRTIMP double __cdecl _hypot(double, double)
Definition: hypot.c:34
static int __signbit(double x)
Definition: math.h:353
_ACRTIMP double __cdecl cosh(double)
Definition: cosh.c:11
_ACRTIMP double __cdecl sqrt(double)
Definition: sqrt.c:5
_ACRTIMP float __cdecl _copysignf(float, float)
Definition: _copysignf.c:34
_ACRTIMP double __cdecl sinh(double)
Definition: sinh.c:50
_ACRTIMP double __cdecl fabs(double)
_ACRTIMP double __cdecl tanh(double)
Definition: tanh.c:46
_ACRTIMP float __cdecl acosf(float)
Definition: acosf.c:47
_ACRTIMP double __cdecl pow(double, double)
Definition: freeldr.c:179
_ACRTIMP double __cdecl _y1(double)
Definition: j1_y1.c:19
_ACRTIMP double __cdecl atan(double)
Definition: atan.c:77
_ACRTIMP __msvcrt_long __cdecl lrint(double)
Definition: mingw_math.h:371
_ACRTIMP __int64 __cdecl llrintf(float)
Definition: mingw_math.h:403
static float hypotf(float x, float y)
Definition: math.h:428
_ACRTIMP float __cdecl rintf(float)
Definition: mingw_math.h:357
_ACRTIMP double __cdecl _cabs(struct _complex)
Definition: math.c:1238
_ACRTIMP __msvcrt_long __cdecl lround(double)
_ACRTIMP double __cdecl log2(double)
Definition: stubs.c:102
_ACRTIMP double __cdecl _j1(double)
Definition: j1_y1.c:10
_ACRTIMP double __cdecl _y0(double)
Definition: j0_y0.c:19
_ACRTIMP double __cdecl sin(double)
Definition: sin.c:21
_ACRTIMP int __cdecl _finitef(float)
Definition: math.c:239
_ACRTIMP __int64 __cdecl llroundf(float)
static double j1(double x)
Definition: math.h:422
static double hypot(double x, double y)
Definition: math.h:420
_ACRTIMP float __cdecl cosf(float)
Definition: cosf.c:13
_ACRTIMP double __cdecl _chgsign(double)
Definition: math.c:1246
_ACRTIMP int __cdecl _isnanf(float)
Definition: math.c:248
_ACRTIMP int __cdecl _fpclassf(float)
Definition: math.c:217
_ACRTIMP float __cdecl sinf(float)
Definition: sinf.c:13
_ACRTIMP double __cdecl fmin(double, double)
Definition: stubs.c:78
static float ldexpf(float x, int y)
Definition: math.h:247
_ACRTIMP __int64 __cdecl llround(double)
_ACRTIMP double __cdecl ceil(double)
Definition: ceil.c:18
_ACRTIMP float __cdecl _hypotf(float, float)
Definition: hypotf.c:45
_ACRTIMP double __cdecl _j0(double)
Definition: j0_y0.c:10
_ACRTIMP double __cdecl fmax(double, double)
Definition: stubs.c:66
_ACRTIMP float __cdecl fmaxf(float, float)
Definition: stubs.c:73
#define copysignf(x, y)
Definition: math.h:254
_ACRTIMP double __cdecl tan(double)
Definition: tan.c:122
_ACRTIMP double __cdecl fmod(double, double)
Definition: fmod.c:18
_ACRTIMP float __cdecl logf(float)
Definition: logf.c:12
_ACRTIMP double __cdecl modf(double, double *)
Definition: modf.c:30
_ACRTIMP float __cdecl tanhf(float)
Definition: tanhf.c:49
static double jn(int n, double x)
Definition: math.h:423
_ACRTIMP int __cdecl _matherr(struct _exception *)
Definition: math.c:119
_ACRTIMP float __cdecl fabsf(float)
_ACRTIMP double __cdecl floor(double)
Definition: floor.c:18
_ACRTIMP float __cdecl _logbf(float)
Definition: logbf.c:38
_ACRTIMP double __cdecl ldexp(double, int)
Definition: math.c:1223
_ACRTIMP float __cdecl log2f(float)
Definition: stubs.c:108
_ACRTIMP float __cdecl log10f(float)
_ACRTIMP double __cdecl asin(double)
Definition: asin.c:31
_ACRTIMP double __cdecl frexp(double, int *)
Definition: frexp.c:14
static float frexpf(float x, int *y)
Definition: math.h:213
_ACRTIMP float __cdecl modff(float, float *)
Definition: modff.c:30
static double yn(int n, double x)
Definition: math.h:426
_ACRTIMP float __cdecl roundf(float)
Definition: roundf.c:10
_ACRTIMP float __cdecl tanf(float)
Definition: tanf.c:72
_ACRTIMP double __cdecl cos(double)
Definition: cos.c:21
_ACRTIMP __msvcrt_long __cdecl lroundf(float)
_ACRTIMP double __cdecl atan2(double, double)
Definition: atan2.c:52
_ACRTIMP __msvcrt_long __cdecl lrintf(float)
Definition: mingw_math.h:379
_ACRTIMP double __cdecl acos(double)
Definition: acos.c:28
#define copysign(x, y)
Definition: math.h:253
_ACRTIMP float __cdecl expf(float)
_ACRTIMP float __cdecl exp2f(float)
Definition: mathf.c:69
_ACRTIMP float __cdecl atan2f(float, float)
Definition: atan2f.c:51
_ACRTIMP double __cdecl rint(double)
Definition: mingw_math.h:350
_ACRTIMP float __cdecl coshf(float)
Definition: coshf.c:51
_ACRTIMP double __cdecl _nextafter(double, double)
_ACRTIMP float __cdecl fmodf(float, float)
_ACRTIMP float __cdecl sinhf(float)
Definition: sinhf.c:51
_ACRTIMP float __cdecl fminf(float, float)
Definition: stubs.c:85
static long double atan2l(long double x, long double y)
Definition: math.h:429
_ACRTIMP int __cdecl _isnan(double)
Definition: math.c:1679
_ACRTIMP double __cdecl _jn(int, double)
Definition: jn_yn.c:12
_ACRTIMP float __cdecl _chgsignf(float)
Definition: math.c:203
int CDECL _set_SSE2_enable(int flag)
Definition: math.c:168
#define abs(i)
Definition: fconv.c:206
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
Definition: glfuncs.h:52
#define e
Definition: ke_i.h:82
GLint y0
Definition: linetemp.h:96
#define sign(x)
Definition: mapdesc.cc:613
#define modfl
Definition: modf.c:12
static unsigned int number
Definition: dsound.c:1479
DWORD exp
Definition: msg.c:18625
#define ceilf(x)
Definition: mymath.h:62
#define floorf(x)
Definition: mymath.h:65
#define sqrtf(x)
Definition: mymath.h:59
#define _Inout_
Definition: no_sal2.h:162
#define _In_z_
Definition: no_sal2.h:164
#define _Check_return_
Definition: no_sal2.h:60
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
const WCHAR * str
_Check_return_ __CRT_INLINE long double coshl(_In_ long double x)
Definition: math.h:265
_Check_return_ __CRT_INLINE long lroundl(_In_ long double x)
Definition: math.h:315
_Check_return_ __CRT_INLINE long double roundl(_In_ long double x)
Definition: math.h:312
_Check_return_ __CRT_INLINE long double sinhl(_In_ long double x)
Definition: math.h:276
_Check_return_ long long __cdecl llabs(_In_ long long x)
Definition: stdlib.h:1435
_Check_return_ long __cdecl labs(_In_ long x)
_Check_return_ __CRT_INLINE long double fmodl(_In_ long double x, _In_ long double y)
Definition: math.h:269
_Check_return_ __CRT_INLINE long double cosl(_In_ long double x)
Definition: math.h:264
_Check_return_ __CRT_INLINE long double ceill(_In_ long double x)
Definition: math.h:263
_Check_return_ __CRT_INLINE long double frexpl(_In_ long double x, _Out_ int *y)
Definition: math.h:270
_Check_return_ __CRT_INLINE long double log10l(_In_ long double x)
Definition: math.h:273
float float_t
Definition: math.h:15
_Check_return_ __CRT_INLINE long double _hypotl(_In_ long double x, _In_ long double y)
Definition: math.h:281
_CRTIMP double const _HUGE
Definition: huge_val.c:6
_In_ double y
Definition: math.h:396
_Check_return_ _CRTIMP double __cdecl _atof_l(_In_z_ const char *str, _In_opt_ _locale_t locale)
_Check_return_ __CRT_INLINE long double fabsl(_In_ long double x)
Definition: math.h:267
_Check_return_ __CRT_INLINE long double powl(_In_ long double x, _In_ long double y)
Definition: math.h:274
_Check_return_ __CRT_INLINE long lrintl(_In_ long double x)
Definition: math.h:324
_Check_return_ __CRT_INLINE long double _chgsignl(_In_ long double number)
Definition: math.h:279
_Check_return_ __CRT_INLINE long double acosl(_In_ long double x)
Definition: math.h:259
_Check_return_ __CRT_INLINE long double __CRTDECL tanl(_In_ long double x)
Definition: math.h:183
_Check_return_ __CRT_INLINE long long llroundl(_In_ long double x)
Definition: math.h:318
_Check_return_ __CRT_INLINE long double _copysignl(_In_ long double number, _In_ long double sign)
Definition: math.h:280
_Check_return_ __CRT_INLINE long double expl(_In_ long double x)
Definition: math.h:266
_Check_return_ __CRT_INLINE long double rintl(_In_ long double x)
Definition: math.h:321
_Check_return_ __CRT_INLINE long double sqrtl(_In_ long double x)
Definition: math.h:277
_Check_return_ __CRT_INLINE long double ldexpl(_In_ long double x, _In_ int y)
Definition: math.h:282
_Check_return_ __CRT_INLINE long double tanhl(_In_ long double x)
Definition: math.h:278
_Check_return_ __CRT_INLINE long long llrintl(_In_ long double x)
Definition: math.h:327
_Check_return_ __CRT_INLINE long double atanl(_In_ long double x)
Definition: math.h:261
double double_t
Definition: math.h:16
_Check_return_ __CRT_INLINE long double logl(_In_ long double x)
Definition: math.h:272
_Check_return_ __CRT_INLINE long double sinl(_In_ long double x)
Definition: math.h:275
_Check_return_ __CRT_INLINE long double hypotl(_In_ long double x, _In_ long double y)
Definition: math.h:271
_Check_return_ __CRT_INLINE long double floorl(_In_ long double x)
Definition: math.h:268
_Check_return_ __CRT_INLINE long double asinl(_In_ long double x)
Definition: math.h:260
#define _CRT_NONSTDC_DEPRECATE(_NewName)
Definition: corecrt.h:439
#define _CRT_JIT_INTRINSIC
Definition: corecrt.h:175
#define log(outFile, fmt,...)
Definition: util.h:15
double atof()
Definition: math.h:42
double y
Definition: math.h:44
double x
Definition: math.h:43
double retval
Definition: math.h:35
char * name
Definition: math.h:32
double arg2
Definition: math.h:34
int type
Definition: math.h:31
double arg1
Definition: math.h:33
long sgn(REAL x)
Definition: varray.cc:48
#define _CRTIMP
Definition: vcruntime.h:54
#define round(x)
Definition: opentype.c:51
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3709
#define __CRTDECL
Definition: yvals.h:17