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.PD within this package.
10
#pragma GCC system_header
17
#pragma pack(push,_CRT_PACKING)
19
#define _DOMAIN 1 /* domain error in argument */
20
#define _SING 2 /* singularity */
21
#define _OVERFLOW 3 /* range overflow */
22
#define _UNDERFLOW 4 /* range underflow */
23
#define _TLOSS 5 /* total loss of precision */
24
#define _PLOSS 6 /* partial loss of precision */
26
#ifndef __STRICT_ANSI__
29
#define DOMAIN _DOMAIN
31
#define OVERFLOW _OVERFLOW
32
#define UNDERFLOW _UNDERFLOW
39
#ifndef __STRICT_ANSI__
40
#define M_E 2.7182818284590452354
41
#define M_LOG2E 1.4426950408889634074
42
#define M_LOG10E 0.43429448190325182765
43
#define M_LN2 0.69314718055994530942
44
#define M_LN10 2.30258509299404568402
45
#define M_PI 3.14159265358979323846
46
#define M_PI_2 1.57079632679489661923
47
#define M_PI_4 0.78539816339744830962
48
#define M_1_PI 0.31830988618379067154
49
#define M_2_PI 0.63661977236758134308
50
#define M_2_SQRTPI 1.12837916709551257390
51
#define M_SQRT2 1.41421356237309504880
52
#define M_SQRT1_2 0.70710678118654752440
55
#ifndef __STRICT_ANSI__
56
/* See also float.h */
57
#ifndef __MINGW_FPCLASS_DEFINED
58
#define __MINGW_FPCLASS_DEFINED 1
59
/* IEEE 754 classication */
60
#define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
61
#define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
62
#define _FPCLASS_NINF 0x0004 /* Negative Infinity */
63
#define _FPCLASS_NN 0x0008 /* Negative Normal */
64
#define _FPCLASS_ND 0x0010 /* Negative Denormal */
65
#define _FPCLASS_NZ 0x0020 /* Negative Zero */
66
#define _FPCLASS_PZ 0x0040 /* Positive Zero */
67
#define _FPCLASS_PD 0x0080 /* Positive Denormal */
68
#define _FPCLASS_PN 0x0100 /* Positive Normal */
69
#define _FPCLASS_PINF 0x0200 /* Positive Infinity */
80
extern double * __MINGW_IMP_SYMBOL(_HUGE);
81
#define _HUGE (* __MINGW_IMP_SYMBOL(_HUGE))
84
#if __MINGW_GNUC_PREREQ(3, 3)
85
#define HUGE_VAL __builtin_huge_val()
87
#define HUGE_VAL _HUGE
90
#ifndef _EXCEPTION_DEFINED
91
#define _EXCEPTION_DEFINED
101
double __cdecl sin(double _X);
102
double __cdecl cos(double _X);
103
double __cdecl tan(double _X);
104
double __cdecl sinh(double _X);
105
double __cdecl cosh(double _X);
106
double __cdecl tanh(double _X);
107
double __cdecl asin(double _X);
108
double __cdecl acos(double _X);
109
double __cdecl atan(double _X);
110
double __cdecl atan2(double _Y,double _X);
111
double __cdecl exp(double _X);
112
double __cdecl log(double _X);
113
double __cdecl log10(double _X);
114
double __cdecl pow(double _X,double _Y);
115
double __cdecl sqrt(double _X);
116
double __cdecl ceil(double _X);
117
double __cdecl floor(double _X);
118
double __cdecl fabs(double _X);
119
double __cdecl ldexp(double _X,int _Y);
120
double __cdecl frexp(double _X,int *_Y);
121
double __cdecl modf(double _X,double *_Y);
122
double __cdecl fmod(double _X,double _Y);
124
#ifndef _CRT_ABS_DEFINED
125
#define _CRT_ABS_DEFINED
126
int __cdecl abs(int _X);
127
long __cdecl labs(long _X);
129
#ifndef _CRT_ATOF_DEFINED
130
#define _CRT_ATOF_DEFINED
131
double __cdecl atof(const char *_String);
132
double __cdecl _atof_l(const char *_String,_locale_t _Locale);
138
#ifndef __STRICT_ANSI__
140
#ifndef _COMPLEX_DEFINED
141
#define _COMPLEX_DEFINED
148
_CRTIMP double __cdecl _cabs(struct _complex _ComplexA);
149
double __cdecl _hypot(double _X,double _Y);
150
_CRTIMP double __cdecl _j0(double _X);
151
_CRTIMP double __cdecl _j1(double _X);
152
_CRTIMP double __cdecl _jn(int _X,double _Y);
153
_CRTIMP double __cdecl _y0(double _X);
154
_CRTIMP double __cdecl _y1(double _X);
155
_CRTIMP double __cdecl _yn(int _X,double _Y);
156
#ifndef _CRT_MATHERR_DEFINED
157
#define _CRT_MATHERR_DEFINED
158
_CRTIMP int __cdecl _matherr (struct _exception *);
161
/* These are also declared in Mingw float.h; needed here as well to work
162
around GCC build issues. */
163
/* BEGIN FLOAT.H COPY */
165
* IEEE recommended functions
167
#ifndef _SIGN_DEFINED
168
#define _SIGN_DEFINED
169
_CRTIMP double __cdecl _chgsign (double _X);
170
_CRTIMP double __cdecl _copysign (double _Number,double _Sign);
171
_CRTIMP double __cdecl _logb (double);
172
_CRTIMP double __cdecl _nextafter (double, double);
173
_CRTIMP double __cdecl _scalb (double, long);
174
_CRTIMP int __cdecl _finite (double);
175
_CRTIMP int __cdecl _fpclass (double);
176
_CRTIMP int __cdecl _isnan (double);
179
/* END FLOAT.H COPY */
181
#if !defined(NO_OLDNAMES)
183
_CRTIMP double __cdecl j0 (double);
184
_CRTIMP double __cdecl j1 (double);
185
_CRTIMP double __cdecl jn (int, double);
186
_CRTIMP double __cdecl y0 (double);
187
_CRTIMP double __cdecl y1 (double);
188
_CRTIMP double __cdecl yn (int, double);
190
_CRTIMP double __cdecl chgsign (double);
192
* scalb() is a GCC built-in.
193
* Exclude this _scalb() stub; the semantics are incompatible
194
* with the built-in implementation.
196
_CRTIMP double __cdecl scalb (double, long);
199
_CRTIMP int __cdecl finite (double);
200
_CRTIMP int __cdecl fpclass (double);
202
#define FP_SNAN _FPCLASS_SNAN
203
#define FP_QNAN _FPCLASS_QNAN
204
#define FP_NINF _FPCLASS_NINF
205
#define FP_PINF _FPCLASS_PINF
206
#define FP_NDENORM _FPCLASS_ND
207
#define FP_PDENORM _FPCLASS_PD
208
#define FP_NZERO _FPCLASS_NZ
209
#define FP_PZERO _FPCLASS_PZ
210
#define FP_NNORM _FPCLASS_NN
211
#define FP_PNORM _FPCLASS_PN
213
#endif /* !defined (_NO_OLDNAMES) && !define (NO_OLDNAMES) */
215
#if(defined(_X86_) && !defined(__x86_64))
216
_CRTIMP int __cdecl _set_SSE2_enable(int _Flag);
222
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
223
|| !defined __STRICT_ANSI__ || defined __cplusplus
225
#if __MINGW_GNUC_PREREQ(3, 3)
226
#define HUGE_VALF __builtin_huge_valf()
227
#define HUGE_VALL __builtin_huge_vall()
228
#define INFINITY __builtin_inf()
229
#define NAN __builtin_nan("")
231
extern const float __INFF;
232
#define HUGE_VALF __INFF
233
extern const long double __INFL;
234
#define HUGE_VALL __INFL
235
#define INFINITY HUGE_VALF
236
extern const double __QNAN;
238
#endif /* __MINGW_GNUC_PREREQ(3, 3) */
240
/* Use the compiler's builtin define for FLT_EVAL_METHOD to
241
set float_t and double_t. */
242
#if defined(__FLT_EVAL_METHOD__)
243
# if ( __FLT_EVAL_METHOD__== 0)
244
typedef float float_t;
245
typedef double double_t;
246
# elif (__FLT_EVAL_METHOD__ == 1)
247
typedef double float_t;
248
typedef double double_t;
249
# elif (__FLT_EVAL_METHOD__ == 2)
250
typedef long double float_t;
251
typedef long double double_t;
253
#else /* ix87 FPU default */
254
typedef long double float_t;
255
typedef long double double_t;
260
Return values for fpclassify.
261
These are based on Intel x87 fpu condition codes
262
in the high byte of status word and differ from
263
the return values for MS IEEE 754 extension _fpclass()
265
#define FP_NAN 0x0100
266
#define FP_NORMAL 0x0400
267
#define FP_INFINITE (FP_NAN | FP_NORMAL)
268
#define FP_ZERO 0x4000
269
#define FP_SUBNORMAL (FP_NORMAL | FP_ZERO)
270
/* 0x0200 is signbit mask */
273
We can't inline float or double, because we want to ensure truncation
274
to semantic type before classification.
275
(A normal long double value might become subnormal when
276
converted to double, and zero when converted to float.)
279
extern int __cdecl __fpclassifyl (long double);
280
extern int __cdecl __fpclassifyf (float);
281
extern int __cdecl __fpclassify (double);
283
#ifndef __CRT__NO_INLINE
284
__CRT_INLINE int __cdecl __fpclassifyl (long double x) {
286
__asm__ __volatile__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x));
287
return sw & (FP_NAN | FP_NORMAL | FP_ZERO );
289
__CRT_INLINE int __cdecl __fpclassify (double x) {
291
__asm__ __volatile__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x));
292
return sw & (FP_NAN | FP_NORMAL | FP_ZERO );
294
__CRT_INLINE int __cdecl __fpclassifyf (float x) {
296
__asm__ __volatile__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x));
297
return sw & (FP_NAN | FP_NORMAL | FP_ZERO );
301
#define fpclassify(x) (sizeof (x) == sizeof (float) ? __fpclassifyf (x) \
302
: sizeof (x) == sizeof (double) ? __fpclassify (x) \
306
#define isfinite(x) ((fpclassify(x) & FP_NAN) == 0)
309
#define isinf(x) (fpclassify(x) == FP_INFINITE)
312
/* We don't need to worry about truncation here:
313
A NaN stays a NaN. */
315
extern int __cdecl __isnan (double);
316
extern int __cdecl __isnanf (float);
317
extern int __cdecl __isnanl (long double);
319
#ifndef __CRT__NO_INLINE
320
__CRT_INLINE int __cdecl __isnan (double _x)
323
__asm__ __volatile__ ("fxam;"
324
"fstsw %%ax": "=a" (sw) : "t" (_x));
325
return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
329
__CRT_INLINE int __cdecl __isnanf (float _x)
332
__asm__ __volatile__ ("fxam;"
333
"fstsw %%ax": "=a" (sw) : "t" (_x));
334
return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
338
__CRT_INLINE int __cdecl __isnanl (long double _x)
341
__asm__ __volatile__ ("fxam;"
342
"fstsw %%ax": "=a" (sw) : "t" (_x));
343
return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
348
#define isnan(x) (sizeof (x) == sizeof (float) ? __isnanf (x) \
349
: sizeof (x) == sizeof (double) ? __isnan (x) \
353
#define isnormal(x) (fpclassify(x) == FP_NORMAL)
355
/* 7.12.3.6 The signbit macro */
356
extern int __cdecl __signbit (double);
357
extern int __cdecl __signbitf (float);
358
extern int __cdecl __signbitl (long double);
359
#ifndef __CRT__NO_INLINE
360
__CRT_INLINE int __cdecl __signbit (double x) {
362
__asm__ __volatile__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
366
__CRT_INLINE int __cdecl __signbitf (float x) {
368
__asm__ __volatile__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
372
__CRT_INLINE int __cdecl __signbitl (long double x) {
374
__asm__ __volatile__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
379
#define signbit(x) (sizeof (x) == sizeof (float) ? __signbitf (x) \
380
: sizeof (x) == sizeof (double) ? __signbit (x) \
383
/* 7.12.4 Trigonometric functions: Double in C89 */
384
extern float __cdecl sinf(float _X);
385
extern long double __cdecl sinl(long double);
387
extern float __cdecl cosf(float _X);
388
extern long double __cdecl cosl(long double);
390
extern float __cdecl tanf(float _X);
391
extern long double __cdecl tanl(long double);
392
extern float __cdecl asinf(float _X);
393
extern long double __cdecl asinl(long double);
395
extern float __cdecl acosf (float);
396
extern long double __cdecl acosl (long double);
398
extern float __cdecl atanf (float);
399
extern long double __cdecl atanl (long double);
401
extern float __cdecl atan2f (float, float);
402
extern long double __cdecl atan2l (long double, long double);
404
/* 7.12.5 Hyperbolic functions: Double in C89 */
405
extern float __cdecl sinhf(float _X);
406
#ifndef __CRT__NO_INLINE
407
__CRT_INLINE float sinhf(float _X) { return ((float)sinh((double)_X)); }
409
extern long double __cdecl sinhl(long double);
411
extern float __cdecl coshf(float _X);
412
#ifndef __CRT__NO_INLINE
413
__CRT_INLINE float coshf(float _X) { return ((float)cosh((double)_X)); }
415
extern long double __cdecl coshl(long double);
417
extern float __cdecl tanhf(float _X);
418
#ifndef __CRT__NO_INLINE
419
__CRT_INLINE float tanhf(float _X) { return ((float)tanh((double)_X)); }
421
extern long double __cdecl tanhl(long double);
423
/* Inverse hyperbolic trig functions */
425
extern double __cdecl acosh (double);
426
extern float __cdecl acoshf (float);
427
extern long double __cdecl acoshl (long double);
430
extern double __cdecl asinh (double);
431
extern float __cdecl asinhf (float);
432
extern long double __cdecl asinhl (long double);
435
extern double __cdecl atanh (double);
436
extern float __cdecl atanhf (float);
437
extern long double __cdecl atanhl (long double);
439
/* Exponentials and logarithms */
440
/* 7.12.6.1 Double in C89 */
441
extern float __cdecl expf(float _X);
442
#ifndef __CRT__NO_INLINE
443
__CRT_INLINE float expf(float _X) { return ((float)exp((double)_X)); }
445
extern long double __cdecl expl(long double);
448
extern double __cdecl exp2(double);
449
extern float __cdecl exp2f(float);
450
extern long double __cdecl exp2l(long double);
452
/* 7.12.6.3 The expm1 functions */
453
/* TODO: These could be inlined */
454
extern double __cdecl expm1(double);
455
extern float __cdecl expm1f(float);
456
extern long double __cdecl expm1l(long double);
458
/* 7.12.6.4 Double in C89 */
459
extern float frexpf(float _X,int *_Y);
460
#ifndef __CRT__NO_INLINE
461
__CRT_INLINE float frexpf(float _X,int *_Y) { return ((float)frexp((double)_X,_Y)); }
463
extern long double __cdecl frexpl(long double,int *);
466
#define FP_ILOGB0 ((int)0x80000000)
467
#define FP_ILOGBNAN ((int)0x80000000)
468
extern int __cdecl ilogb (double);
469
extern int __cdecl ilogbf (float);
470
extern int __cdecl ilogbl (long double);
472
/* 7.12.6.6 Double in C89 */
473
extern float __cdecl ldexpf(float _X,int _Y);
474
#ifndef __CRT__NO_INLINE
475
__CRT_INLINE float __cdecl ldexpf (float x, int expn) { return (float) ldexp ((double)x, expn); }
477
extern long double __cdecl ldexpl (long double, int);
479
/* 7.12.6.7 Double in C89 */
480
extern float __cdecl logf (float);
481
extern long double __cdecl logl(long double);
483
/* 7.12.6.8 Double in C89 */
484
extern float __cdecl log10f (float);
485
extern long double __cdecl log10l(long double);
488
extern double __cdecl log1p(double);
489
extern float __cdecl log1pf(float);
490
extern long double __cdecl log1pl(long double);
493
extern double __cdecl log2 (double);
494
extern float __cdecl log2f (float);
495
extern long double __cdecl log2l (long double);
498
extern double __cdecl logb (double);
499
extern float __cdecl logbf (float);
500
extern long double __cdecl logbl (long double);
502
/* Inline versions. GCC-4.0+ can do a better fast-math optimization
504
#ifndef __CRT__NO_INLINE
505
#if !(__MINGW_GNUC_PREREQ (4, 0) && defined (__FAST_MATH__))
506
__CRT_INLINE double __cdecl logb (double x)
509
__asm__ __volatile__ ("fxtract\n\t"
510
"fstp %%st" : "=t" (res) : "0" (x));
514
__CRT_INLINE float __cdecl logbf (float x)
517
__asm__ __volatile__ ("fxtract\n\t"
518
"fstp %%st" : "=t" (res) : "0" (x));
522
__CRT_INLINE long double __cdecl logbl (long double x)
524
long double res = 0.0l;
525
__asm__ __volatile__ ("fxtract\n\t"
526
"fstp %%st" : "=t" (res) : "0" (x));
529
#endif /* !defined __FAST_MATH__ || !__MINGW_GNUC_PREREQ (4, 0) */
530
#endif /* __CRT__NO_INLINE */
532
/* 7.12.6.12 Double in C89 */
533
extern float __cdecl modff (float, float*);
534
extern long double __cdecl modfl (long double, long double*);
537
extern double __cdecl scalbn (double, int);
538
extern float __cdecl scalbnf (float, int);
539
extern long double __cdecl scalbnl (long double, int);
541
extern double __cdecl scalbln (double, long);
542
extern float __cdecl scalblnf (float, long);
543
extern long double __cdecl scalblnl (long double, long);
546
/* Implementations adapted from Cephes versions */
547
extern double __cdecl cbrt (double);
548
extern float __cdecl cbrtf (float);
549
extern long double __cdecl cbrtl (long double);
551
/* 7.12.7.2 The fabs functions: Double in C89 */
552
extern float __cdecl fabsf (float x);
553
#ifndef __CRT__NO_INLINE
554
#if !defined (__ia64__)
555
__CRT_INLINE float __cdecl fabsf (float x)
558
__asm__ __volatile__ ("fabs;" : "=t" (res) : "0" (x));
563
extern long double __cdecl fabsl (long double);
564
#ifndef __CRT__NO_INLINE
565
#if !defined (__ia64__)
566
__CRT_INLINE long double __cdecl fabsl (long double x)
568
long double res = 0.0l;
569
__asm__ __volatile__ ("fabs;" : "=t" (res) : "0" (x));
575
extern double __cdecl hypot (double, double); /* in libmoldname.a */
576
extern float __cdecl hypotf (float x, float y);
577
#ifndef __CRT__NO_INLINE
578
__CRT_INLINE float __cdecl hypotf (float x, float y) { return (float) hypot ((double)x, (double)y);}
580
extern long double __cdecl hypotl (long double, long double);
582
/* 7.12.7.4 The pow functions. Double in C89 */
583
extern float __cdecl powf(float _X,float _Y);
584
#ifndef __CRT__NO_INLINE
585
__CRT_INLINE float powf(float _X,float _Y) { return ((float)pow((double)_X,(double)_Y)); }
587
extern long double __cdecl powl (long double, long double);
589
/* 7.12.7.5 The sqrt functions. Double in C89. */
590
extern float __cdecl sqrtf (float);
591
extern long double sqrtl(long double);
593
/* 7.12.8.1 The erf functions */
594
extern double __cdecl erf (double);
595
extern float __cdecl erff (float);
596
extern long double __cdecl erfl (long double);
598
/* 7.12.8.2 The erfc functions */
599
extern double __cdecl erfc (double);
600
extern float __cdecl erfcf (float);
601
extern long double __cdecl erfcl (long double);
603
/* 7.12.8.3 The lgamma functions */
604
extern double __cdecl lgamma (double);
605
extern float __cdecl lgammaf (float);
606
extern long double __cdecl lgammal (long double);
608
/* 7.12.8.4 The tgamma functions */
609
extern double __cdecl tgamma (double);
610
extern float __cdecl tgammaf (float);
611
extern long double __cdecl tgammal (long double);
613
/* 7.12.9.1 Double in C89 */
614
extern float __cdecl ceilf (float);
615
extern long double __cdecl ceill (long double);
617
/* 7.12.9.2 Double in C89 */
618
extern float __cdecl floorf (float);
619
extern long double __cdecl floorl (long double);
622
extern double __cdecl nearbyint ( double);
623
extern float __cdecl nearbyintf (float);
624
extern long double __cdecl nearbyintl (long double);
627
/* round, using fpu control word settings */
628
extern double __cdecl rint (double);
629
extern float __cdecl rintf (float);
630
extern long double __cdecl rintl (long double);
633
extern long __cdecl lrint (double);
634
extern long __cdecl lrintf (float);
635
extern long __cdecl lrintl (long double);
637
__MINGW_EXTENSION long long __cdecl llrint (double);
638
__MINGW_EXTENSION long long __cdecl llrintf (float);
639
__MINGW_EXTENSION long long __cdecl llrintl (long double);
641
/* Inline versions of above.
642
GCC 4.0+ can do a better fast-math job with __builtins. */
644
#ifndef __CRT__NO_INLINE
645
#if !(__MINGW_GNUC_PREREQ (4, 0) && defined __FAST_MATH__ )
646
__CRT_INLINE double __cdecl rint (double x)
649
__asm__ __volatile__ ("frndint;": "=t" (retval) : "0" (x));
653
__CRT_INLINE float __cdecl rintf (float x)
656
__asm__ __volatile__ ("frndint;" : "=t" (retval) : "0" (x) );
660
__CRT_INLINE long double __cdecl rintl (long double x)
662
long double retval = 0.0l;
663
__asm__ __volatile__ ("frndint;" : "=t" (retval) : "0" (x) );
667
__CRT_INLINE long __cdecl lrint (double x)
670
__asm__ __volatile__ \
671
("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \
675
__CRT_INLINE long __cdecl lrintf (float x)
678
__asm__ __volatile__ \
679
("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \
683
__CRT_INLINE long __cdecl lrintl (long double x)
686
__asm__ __volatile__ \
687
("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \
691
__MINGW_EXTENSION __CRT_INLINE long long __cdecl llrint (double x)
693
__MINGW_EXTENSION long long retval = 0ll;
694
__asm__ __volatile__ \
695
("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \
699
__MINGW_EXTENSION __CRT_INLINE long long __cdecl llrintf (float x)
701
__MINGW_EXTENSION long long retval = 0ll;
702
__asm__ __volatile__ \
703
("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \
707
__MINGW_EXTENSION __CRT_INLINE long long __cdecl llrintl (long double x)
709
__MINGW_EXTENSION long long retval = 0ll;
710
__asm__ __volatile__ \
711
("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \
714
#endif /* !__FAST_MATH__ || !__MINGW_GNUC_PREREQ (4,0) */
715
#endif /* !__CRT__NO_INLINE */
718
/* round away from zero, regardless of fpu control word settings */
719
extern double __cdecl round (double);
720
extern float __cdecl roundf (float);
721
extern long double __cdecl roundl (long double);
724
extern long __cdecl lround (double);
725
extern long __cdecl lroundf (float);
726
extern long __cdecl lroundl (long double);
727
__MINGW_EXTENSION long long __cdecl llround (double);
728
__MINGW_EXTENSION long long __cdecl llroundf (float);
729
__MINGW_EXTENSION long long __cdecl llroundl (long double);
732
/* round towards zero, regardless of fpu control word settings */
733
extern double __cdecl trunc (double);
734
extern float __cdecl truncf (float);
735
extern long double __cdecl truncl (long double);
737
/* 7.12.10.1 Double in C89 */
738
extern float __cdecl fmodf (float, float);
739
extern long double __cdecl fmodl (long double, long double);
742
extern double __cdecl remainder (double, double);
743
extern float __cdecl remainderf (float, float);
744
extern long double __cdecl remainderl (long double, long double);
747
extern double __cdecl remquo(double, double, int *);
748
extern float __cdecl remquof(float, float, int *);
749
extern long double __cdecl remquol(long double, long double, int *);
752
extern double __cdecl copysign (double, double); /* in libmoldname.a */
753
extern float __cdecl copysignf (float, float);
754
extern long double __cdecl copysignl (long double, long double);
756
/* 7.12.11.2 Return a NaN */
757
extern double __cdecl nan(const char *tagp);
758
extern float __cdecl nanf(const char *tagp);
759
extern long double __cdecl nanl(const char *tagp);
761
#ifndef __STRICT_ANSI__
762
#define _nan() nan("")
763
#define _nanf() nanf("")
764
#define _nanl() nanl("")
768
extern double __cdecl nextafter (double, double); /* in libmoldname.a */
769
extern float __cdecl nextafterf (float, float);
770
extern long double __cdecl nextafterl (long double, long double);
772
/* 7.12.11.4 The nexttoward functions */
773
extern double __cdecl nexttoward (double, long double);
774
extern float __cdecl nexttowardf (float, long double);
775
extern long double __cdecl nexttowardl (long double, long double);
778
/* x > y ? (x - y) : 0.0 */
779
extern double __cdecl fdim (double x, double y);
780
extern float __cdecl fdimf (float x, float y);
781
extern long double __cdecl fdiml (long double x, long double y);
784
NaN arguments are treated as missing data: if one argument is a NaN
785
and the other numeric, then these functions choose the numeric
789
extern double __cdecl fmax (double, double);
790
extern float __cdecl fmaxf (float, float);
791
extern long double __cdecl fmaxl (long double, long double);
794
extern double __cdecl fmin (double, double);
795
extern float __cdecl fminf (float, float);
796
extern long double __cdecl fminl (long double, long double);
799
/* return x * y + z as a ternary op */
800
extern double __cdecl fma (double, double, double);
801
extern float __cdecl fmaf (float, float, float);
802
extern long double __cdecl fmal (long double, long double, long double);
806
* With these functions, comparisons involving quiet NaNs set the FP
807
* condition code to "unordered". The IEEE floating-point spec
808
* dictates that the result of floating-point comparisons should be
809
* false whenever a NaN is involved, with the exception of the != op,
810
* which always returns true: yes, (NaN != NaN) is true).
815
#define isgreater(x, y) __builtin_isgreater(x, y)
816
#define isgreaterequal(x, y) __builtin_isgreaterequal(x, y)
817
#define isless(x, y) __builtin_isless(x, y)
818
#define islessequal(x, y) __builtin_islessequal(x, y)
819
#define islessgreater(x, y) __builtin_islessgreater(x, y)
820
#define isunordered(x, y) __builtin_isunordered(x, y)
824
#ifndef __CRT__NO_INLINE
825
__CRT_INLINE int __cdecl
826
__fp_unordered_compare (long double x, long double y){
827
unsigned short retval;
828
__asm__ __volatile__ ("fucom %%st(1);"
829
"fnstsw;": "=a" (retval) : "t" (x), "u" (y));
834
#define isgreater(x, y) ((__fp_unordered_compare(x, y) & 0x4500) == 0)
835
#define isless(x, y) ((__fp_unordered_compare (y, x) & 0x4500) == 0)
836
#define isgreaterequal(x, y) ((__fp_unordered_compare (x, y) & FP_INFINITE) == 0)
837
#define islessequal(x, y) ((__fp_unordered_compare(y, x) & FP_INFINITE) == 0)
838
#define islessgreater(x, y) ((__fp_unordered_compare(x, y) & FP_SUBNORMAL) == 0)
839
#define isunordered(x, y) ((__fp_unordered_compare(x, y) & 0x4500) == 0x4500)
843
#endif /* __STDC_VERSION__ >= 199901L */
844
#endif /* __NO_ISOCEXT */
846
#if defined(_X86_) && !defined(__x86_64)
847
_CRTIMP float __cdecl _hypotf(float _X,float _Y);
850
#if !defined(__ia64__)
851
_CRTIMP float __cdecl _copysignf (float _Number,float _Sign);
852
_CRTIMP float __cdecl _chgsignf (float _X);
853
_CRTIMP float __cdecl _logbf(float _X);
854
_CRTIMP float __cdecl _nextafterf(float _X,float _Y);
855
_CRTIMP int __cdecl _finitef(float _X);
856
_CRTIMP int __cdecl _isnanf(float _X);
857
_CRTIMP int __cdecl _fpclassf(float _X);
861
extern long double __cdecl _chgsignl (long double);
862
#define _copysignl copysignl
863
#endif /* _SIGN_DEFINED */
865
#define _hypotl hypotl
868
#define matherr _matherr
876
#endif /* Not RC_INVOKED */
880
#endif /* End _MATH_H_ */