2000-02-17 20:38:33 +01:00
|
|
|
/*
|
|
|
|
* math.h
|
|
|
|
*
|
|
|
|
* Mathematical functions.
|
|
|
|
*
|
|
|
|
* This file is part of the Mingw32 package.
|
|
|
|
*
|
|
|
|
* Contributors:
|
|
|
|
* Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
|
|
|
*
|
|
|
|
* This source code is offered for use in the public domain. You may
|
|
|
|
* use, modify or distribute it freely.
|
|
|
|
*
|
|
|
|
* This code is distributed in the hope that it will be useful but
|
|
|
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
2001-12-05 16:01:06 +01:00
|
|
|
* DISCLAIMED. This includes but is not limited to warranties of
|
2000-02-17 20:38:33 +01:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
*
|
|
|
|
* $Revision$
|
|
|
|
* $Author$
|
|
|
|
* $Date$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MATH_H_
|
|
|
|
#define _MATH_H_
|
|
|
|
|
|
|
|
/* All the headers include this file. */
|
|
|
|
#include <_mingw.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Types for the _exception structure.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define _DOMAIN 1 /* domain error in argument */
|
|
|
|
#define _SING 2 /* singularity */
|
|
|
|
#define _OVERFLOW 3 /* range overflow */
|
|
|
|
#define _UNDERFLOW 4 /* range underflow */
|
|
|
|
#define _TLOSS 5 /* total loss of precision */
|
|
|
|
#define _PLOSS 6 /* partial loss of precision */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Exception types with non-ANSI names for compatibility.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __STRICT_ANSI__
|
2002-04-04 10:54:50 +02:00
|
|
|
#ifndef _NO_OLDNAMES
|
|
|
|
|
|
|
|
#define DOMAIN _DOMAIN
|
|
|
|
#define SING _SING
|
|
|
|
#define OVERFLOW _OVERFLOW
|
|
|
|
#define UNDERFLOW _UNDERFLOW
|
|
|
|
#define TLOSS _TLOSS
|
|
|
|
#define PLOSS _PLOSS
|
|
|
|
|
|
|
|
#endif /* Not _NO_OLDNAMES */
|
|
|
|
#endif /* Not __STRICT_ANSI__ */
|
|
|
|
|
2001-12-05 16:01:06 +01:00
|
|
|
|
2002-12-07 09:58:49 +01:00
|
|
|
/* Traditional/XOPEN math constants (double precison) */
|
|
|
|
#ifndef __STRICT_ANSI__
|
|
|
|
#define M_E 2.7182818284590452354
|
|
|
|
#define M_LOG2E 1.4426950408889634074
|
|
|
|
#define M_LOG10E 0.43429448190325182765
|
|
|
|
#define M_LN2 0.69314718055994530942
|
|
|
|
#define M_LN10 2.30258509299404568402
|
|
|
|
#define M_PI 3.14159265358979323846
|
|
|
|
#define M_PI_2 1.57079632679489661923
|
|
|
|
#define M_PI_4 0.78539816339744830962
|
|
|
|
#define M_1_PI 0.31830988618379067154
|
|
|
|
#define M_2_PI 0.63661977236758134308
|
|
|
|
#define M_2_SQRTPI 1.12837916709551257390
|
|
|
|
#define M_SQRT2 1.41421356237309504880
|
|
|
|
#define M_SQRT1_2 0.70710678118654752440
|
|
|
|
#endif
|
|
|
|
|
2001-12-05 16:01:06 +01:00
|
|
|
/* These are also defined in Mingw float.h; needed here as well to work
|
|
|
|
around GCC build issues. */
|
2002-04-04 10:54:50 +02:00
|
|
|
#ifndef __STRICT_ANSI__
|
2001-12-05 16:01:06 +01:00
|
|
|
#ifndef __MINGW_FPCLASS_DEFINED
|
|
|
|
#define __MINGW_FPCLASS_DEFINED 1
|
2002-06-13 12:20:48 +02:00
|
|
|
/* IEEE 754 classication */
|
2001-12-05 16:01:06 +01:00
|
|
|
#define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
|
|
|
|
#define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
|
|
|
|
#define _FPCLASS_NINF 0x0004 /* Negative Infinity */
|
|
|
|
#define _FPCLASS_NN 0x0008 /* Negative Normal */
|
|
|
|
#define _FPCLASS_ND 0x0010 /* Negative Denormal */
|
|
|
|
#define _FPCLASS_NZ 0x0020 /* Negative Zero */
|
|
|
|
#define _FPCLASS_PZ 0x0040 /* Positive Zero */
|
|
|
|
#define _FPCLASS_PD 0x0080 /* Positive Denormal */
|
|
|
|
#define _FPCLASS_PN 0x0100 /* Positive Normal */
|
|
|
|
#define _FPCLASS_PINF 0x0200 /* Positive Infinity */
|
|
|
|
#endif /* __MINGW_FPCLASS_DEFINED */
|
2000-02-17 20:38:33 +01:00
|
|
|
#endif /* Not __STRICT_ANSI__ */
|
|
|
|
|
|
|
|
#ifndef RC_INVOKED
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* HUGE_VAL is returned by strtod when the value would overflow the
|
|
|
|
* representation of 'double'. There are other uses as well.
|
|
|
|
*
|
|
|
|
* __imp__HUGE is a pointer to the actual variable _HUGE in
|
|
|
|
* MSVCRT.DLL. If we used _HUGE directly we would get a pointer
|
|
|
|
* to a thunk function.
|
|
|
|
*
|
|
|
|
* NOTE: The CRTDLL version uses _HUGE_dll instead.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __DECLSPEC_SUPPORTED
|
|
|
|
|
|
|
|
#ifdef __MSVCRT__
|
2002-06-13 12:20:48 +02:00
|
|
|
extern double* _imp___HUGE;
|
|
|
|
#define HUGE_VAL (*_imp___HUGE)
|
2000-02-17 20:38:33 +01:00
|
|
|
#else
|
|
|
|
/* CRTDLL */
|
2002-06-13 12:20:48 +02:00
|
|
|
extern double* _imp___HUGE_dll;
|
|
|
|
#define HUGE_VAL (*_imp___HUGE_dll)
|
2000-02-17 20:38:33 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#else /* __DECLSPEC_SUPPORTED */
|
|
|
|
|
|
|
|
#ifdef __MSVCRT__
|
|
|
|
__MINGW_IMPORT double _HUGE;
|
|
|
|
#define HUGE_VAL _HUGE
|
|
|
|
#else
|
|
|
|
/* CRTDLL */
|
|
|
|
__MINGW_IMPORT double _HUGE_dll;
|
|
|
|
#define HUGE_VAL _HUGE_dll
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* __DECLSPEC_SUPPORTED */
|
|
|
|
|
|
|
|
struct _exception
|
|
|
|
{
|
|
|
|
int type;
|
|
|
|
char *name;
|
|
|
|
double arg1;
|
|
|
|
double arg2;
|
|
|
|
double retval;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
_CRTIMP double __cdecl sin (double);
|
|
|
|
_CRTIMP double __cdecl cos (double);
|
|
|
|
_CRTIMP double __cdecl tan (double);
|
|
|
|
_CRTIMP double __cdecl sinh (double);
|
|
|
|
_CRTIMP double __cdecl cosh (double);
|
|
|
|
_CRTIMP double __cdecl tanh (double);
|
|
|
|
_CRTIMP double __cdecl asin (double);
|
|
|
|
_CRTIMP double __cdecl acos (double);
|
|
|
|
_CRTIMP double __cdecl atan (double);
|
|
|
|
_CRTIMP double __cdecl atan2 (double, double);
|
|
|
|
_CRTIMP double __cdecl exp (double);
|
|
|
|
_CRTIMP double __cdecl log (double);
|
|
|
|
_CRTIMP double __cdecl log10 (double);
|
2003-02-11 00:56:04 +01:00
|
|
|
#ifdef __NO_ISOCEXT
|
|
|
|
_CRTIMP
|
|
|
|
#endif
|
|
|
|
double __cdecl pow (double, double);
|
2003-02-10 22:13:34 +01:00
|
|
|
_CRTIMP double __cdecl sqrt (double);
|
|
|
|
_CRTIMP double __cdecl ceil (double);
|
|
|
|
_CRTIMP double __cdecl floor (double);
|
|
|
|
_CRTIMP double __cdecl fabs (double);
|
|
|
|
_CRTIMP double __cdecl ldexp (double, int);
|
|
|
|
_CRTIMP double __cdecl frexp (double, int*);
|
|
|
|
_CRTIMP double __cdecl modf (double, double*);
|
|
|
|
_CRTIMP double __cdecl fmod (double, double);
|
2000-02-17 20:38:33 +01:00
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
#ifndef __STRICT_ANSI__
|
2000-02-17 20:38:33 +01:00
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
/* Complex number (for cabs). This really belongs in complex.h */
|
2000-02-17 20:38:33 +01:00
|
|
|
struct _complex
|
|
|
|
{
|
|
|
|
double x; /* Real part */
|
|
|
|
double y; /* Imaginary part */
|
|
|
|
};
|
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
_CRTIMP double __cdecl _cabs (struct _complex);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
_CRTIMP double __cdecl _hypot (double, double);
|
|
|
|
_CRTIMP double __cdecl _j0 (double);
|
|
|
|
_CRTIMP double __cdecl _j1 (double);
|
|
|
|
_CRTIMP double __cdecl _jn (int, double);
|
|
|
|
_CRTIMP double __cdecl _y0 (double);
|
|
|
|
_CRTIMP double __cdecl _y1 (double);
|
|
|
|
_CRTIMP double __cdecl _yn (int, double);
|
|
|
|
_CRTIMP int __cdecl _matherr (struct _exception *);
|
2000-02-17 20:38:33 +01:00
|
|
|
|
2001-12-05 16:01:06 +01:00
|
|
|
/* These are also declared in Mingw float.h; needed here as well to work
|
|
|
|
around GCC build issues. */
|
|
|
|
/* BEGIN FLOAT.H COPY */
|
|
|
|
/*
|
|
|
|
* IEEE recommended functions
|
|
|
|
*/
|
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
_CRTIMP double __cdecl _chgsign (double);
|
|
|
|
_CRTIMP double __cdecl _copysign (double, double);
|
|
|
|
_CRTIMP double __cdecl _logb (double);
|
|
|
|
_CRTIMP double __cdecl _nextafter (double, double);
|
|
|
|
_CRTIMP double __cdecl _scalb (double, long);
|
2001-12-05 16:01:06 +01:00
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
_CRTIMP int __cdecl _finite (double);
|
|
|
|
_CRTIMP int __cdecl _fpclass (double);
|
|
|
|
_CRTIMP int __cdecl _isnan (double);
|
2001-12-05 16:01:06 +01:00
|
|
|
|
|
|
|
/* END FLOAT.H COPY */
|
|
|
|
|
2000-02-17 20:38:33 +01:00
|
|
|
|
|
|
|
/*
|
2002-07-29 05:00:10 +02:00
|
|
|
* Non-underscored versions of non-ANSI functions.
|
|
|
|
* These reside in liboldnames.a.
|
2000-02-17 20:38:33 +01:00
|
|
|
*/
|
2002-06-13 12:20:48 +02:00
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
#if !defined (_NO_OLDNAMES)
|
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
_CRTIMP double __cdecl cabs (struct _complex);
|
|
|
|
_CRTIMP double __cdecl j0 (double);
|
|
|
|
_CRTIMP double __cdecl j1 (double);
|
|
|
|
_CRTIMP double __cdecl jn (int, double);
|
|
|
|
_CRTIMP double __cdecl y0 (double);
|
|
|
|
_CRTIMP double __cdecl y1 (double);
|
|
|
|
_CRTIMP double __cdecl yn (int, double);
|
2000-02-17 20:38:33 +01:00
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
_CRTIMP double __cdecl chgsign (double);
|
|
|
|
_CRTIMP double __cdecl scalb (double, long);
|
|
|
|
_CRTIMP int __cdecl finite (double);
|
|
|
|
_CRTIMP int __cdecl fpclass (double);
|
2000-02-17 20:38:33 +01:00
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
#endif /* Not _NO_OLDNAMES */
|
2000-02-17 20:38:33 +01:00
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
#endif /* __STRICT_ANSI__ */
|
2002-06-13 12:20:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
#ifndef __NO_ISOCEXT
|
|
|
|
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
|
2003-02-10 22:13:34 +01:00
|
|
|
|| !defined __STRICT_ANSI__ || defined __GLIBCPP__
|
2002-06-13 12:20:48 +02:00
|
|
|
|
|
|
|
#define NAN (0.0F/0.0F)
|
2002-07-29 05:00:10 +02:00
|
|
|
#define HUGE_VALF (1.0F/0.0F)
|
|
|
|
#define HUGE_VALL (1.0L/0.0L)
|
|
|
|
#define INFINITY (1.0F/0.0F)
|
|
|
|
|
2002-06-13 12:20:48 +02:00
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
/* 7.12.3.1 */
|
2002-06-13 12:20:48 +02:00
|
|
|
/*
|
|
|
|
Return values for fpclassify.
|
|
|
|
These are based on Intel x87 fpu condition codes
|
|
|
|
in the high byte of status word and differ from
|
|
|
|
the return values for MS IEEE 754 extension _fpclass()
|
|
|
|
*/
|
|
|
|
#define FP_NAN 0x0100
|
|
|
|
#define FP_NORMAL 0x0400
|
|
|
|
#define FP_INFINITE (FP_NAN | FP_NORMAL)
|
|
|
|
#define FP_ZERO 0x4000
|
|
|
|
#define FP_SUBNORMAL (FP_NORMAL | FP_ZERO)
|
|
|
|
/* 0x0200 is signbit mask */
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
We can't inline float or double, because we want to ensure truncation
|
|
|
|
to semantic type before classification.
|
|
|
|
(A normal long double value might become subnormal when
|
|
|
|
converted to double, and zero when converted to float.)
|
|
|
|
*/
|
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
extern int __cdecl __fpclassifyf (float);
|
|
|
|
extern int __cdecl __fpclassify (double);
|
2002-06-13 12:20:48 +02:00
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE int __cdecl __fpclassifyl (long double x){
|
2002-06-13 12:20:48 +02:00
|
|
|
unsigned short sw;
|
|
|
|
__asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x));
|
|
|
|
return sw & (FP_NAN | FP_NORMAL | FP_ZERO );
|
|
|
|
}
|
|
|
|
|
|
|
|
#define fpclassify(x) (sizeof (x) == sizeof (float) ? __fpclassifyf (x) \
|
|
|
|
: sizeof (x) == sizeof (double) ? __fpclassify (x) \
|
|
|
|
: __fpclassifyl (x))
|
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
/* 7.12.3.2 */
|
|
|
|
#define isfinite(x) ((fpclassify(x) & FP_NAN) == 0)
|
|
|
|
|
|
|
|
/* 7.12.3.3 */
|
|
|
|
#define isinf(x) (fpclassify(x) == FP_INFINITE)
|
|
|
|
|
|
|
|
/* 7.12.3.4 */
|
2002-06-13 12:20:48 +02:00
|
|
|
/* We don't need to worry about trucation here:
|
|
|
|
A NaN stays a NaN. */
|
2002-07-29 05:00:10 +02:00
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE int __cdecl __isnan (double _x)
|
2002-06-13 12:20:48 +02:00
|
|
|
{
|
|
|
|
unsigned short sw;
|
|
|
|
__asm__ ("fxam;"
|
|
|
|
"fstsw %%ax": "=a" (sw) : "t" (_x));
|
|
|
|
return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
|
|
|
|
== FP_NAN;
|
|
|
|
}
|
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE int __cdecl __isnanf (float _x)
|
2002-06-13 12:20:48 +02:00
|
|
|
{
|
|
|
|
unsigned short sw;
|
|
|
|
__asm__ ("fxam;"
|
|
|
|
"fstsw %%ax": "=a" (sw) : "t" (_x));
|
|
|
|
return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
|
|
|
|
== FP_NAN;
|
|
|
|
}
|
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE int __cdecl __isnanl (long double _x)
|
2002-06-13 12:20:48 +02:00
|
|
|
{
|
|
|
|
unsigned short sw;
|
|
|
|
__asm__ ("fxam;"
|
|
|
|
"fstsw %%ax": "=a" (sw) : "t" (_x));
|
|
|
|
return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL))
|
|
|
|
== FP_NAN;
|
|
|
|
}
|
2000-02-17 20:38:33 +01:00
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
|
2002-06-13 12:20:48 +02:00
|
|
|
#define isnan(x) (sizeof (x) == sizeof (float) ? __isnanf (x) \
|
|
|
|
: sizeof (x) == sizeof (double) ? __isnan (x) \
|
|
|
|
: __isnanl (x))
|
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
/* 7.12.3.5 */
|
2002-06-13 12:20:48 +02:00
|
|
|
#define isnormal(x) (fpclassify(x) == FP_NORMAL)
|
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
/* 7.12.3.6 The signbit macro */
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE int __cdecl __signbit (double x) {
|
2002-06-13 12:20:48 +02:00
|
|
|
unsigned short stw;
|
|
|
|
__asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
|
|
|
|
return stw & 0x0200;
|
|
|
|
}
|
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE int __cdecl __signbitf (float x) {
|
2002-06-13 12:20:48 +02:00
|
|
|
unsigned short stw;
|
|
|
|
__asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
|
|
|
|
return stw & 0x0200;
|
|
|
|
}
|
2003-02-10 22:13:34 +01:00
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE int __cdecl __signbitl (long double x) {
|
2002-06-13 12:20:48 +02:00
|
|
|
unsigned short stw;
|
|
|
|
__asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x));
|
|
|
|
return stw & 0x0200;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define signbit(x) (sizeof (x) == sizeof (float) ? __signbitf (x) \
|
|
|
|
: sizeof (x) == sizeof (double) ? __signbit (x) \
|
|
|
|
: __signbitl (x))
|
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
/* 7.12.4 Trigonometric functions: Double in C89 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern float __cdecl sinf (float);
|
|
|
|
extern long double __cdecl sinl (long double);
|
2002-06-13 12:20:48 +02:00
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
extern float __cdecl cosf (float);
|
|
|
|
extern long double __cdecl cosl (long double);
|
2002-06-13 12:20:48 +02:00
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
extern float __cdecl tanf (float);
|
|
|
|
extern long double __cdecl tanl (long double);
|
2002-06-13 12:20:48 +02:00
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
extern float __cdecl asinf (float);
|
|
|
|
extern long double __cdecl asinl (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
extern float __cdecl acosf (float);
|
|
|
|
extern long double __cdecl acosl (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
extern float __cdecl atanf (float);
|
|
|
|
extern long double __cdecl atanl (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
extern float __cdecl atan2f (float, float);
|
|
|
|
extern long double __cdecl atan2l (long double, long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.5 Hyperbolic functions: Double in C89 */
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE float __cdecl sinhf (float x)
|
2002-07-29 05:00:10 +02:00
|
|
|
{return (float) sinh (x);}
|
2003-02-10 22:13:34 +01:00
|
|
|
extern long double __cdecl sinhl (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE float __cdecl coshf (float x)
|
2002-07-29 05:00:10 +02:00
|
|
|
{return (float) cosh (x);}
|
2003-02-10 22:13:34 +01:00
|
|
|
extern long double __cdecl coshl (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE float __cdecl tanhf (float x)
|
2002-07-29 05:00:10 +02:00
|
|
|
{return (float) tanh (x);}
|
2003-02-10 22:13:34 +01:00
|
|
|
extern long double __cdecl tanhl (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* TODO: asinh, acosh, atanh
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* 7.12.6.1 Double in C89 */
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE float __cdecl expf (float x)
|
2002-07-29 05:00:10 +02:00
|
|
|
{return (float) exp (x);}
|
2003-02-10 22:13:34 +01:00
|
|
|
extern long double __cdecl expl (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.6.2 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl exp2(double);
|
|
|
|
extern float __cdecl exp2f(float);
|
|
|
|
extern long double __cdecl exp2l(long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.6.3 The expm1 functions: TODO */
|
|
|
|
|
|
|
|
/* 7.12.6.4 Double in C89 */
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE float __cdecl frexpf (float x, int* expn)
|
2002-07-29 05:00:10 +02:00
|
|
|
{return (float) frexp (x, expn);}
|
2003-02-10 22:13:34 +01:00
|
|
|
extern long double __cdecl frexpl (long double, int*);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.6.5 */
|
|
|
|
#define FP_ILOGB0 ((int)0x80000000)
|
|
|
|
#define FP_ILOGBNAN ((int)0x80000000)
|
2003-02-10 22:13:34 +01:00
|
|
|
extern int __cdecl ilogb (double);
|
|
|
|
extern int __cdecl ilogbf (float);
|
|
|
|
extern int __cdecl ilogbl (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.6.6 Double in C89 */
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE float __cdecl ldexpf (float x, int expn)
|
2002-07-29 05:00:10 +02:00
|
|
|
{return (float) ldexp (x, expn);}
|
2003-02-10 22:13:34 +01:00
|
|
|
extern long double __cdecl ldexpl (long double, int);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.6.7 Double in C89 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern float __cdecl logf (float);
|
|
|
|
extern long double __cdecl logl (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.6.8 Double in C89 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern float __cdecl log10f (float);
|
|
|
|
extern long double __cdecl log10l (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.6.9 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl log1p(double);
|
|
|
|
extern float __cdecl log1pf(float);
|
|
|
|
extern long double __cdecl log1pl(long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.6.10 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl log2 (double);
|
|
|
|
extern float __cdecl log2f (float);
|
|
|
|
extern long double __cdecl log2l (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.6.11 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl logb (double);
|
|
|
|
extern float __cdecl logbf (float);
|
|
|
|
extern long double __cdecl logbl (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE double __cdecl logb (double x)
|
2002-07-29 05:00:10 +02:00
|
|
|
{
|
|
|
|
double res;
|
2002-08-21 01:26:11 +02:00
|
|
|
__asm__ ("fxtract\n\t"
|
2002-07-29 05:00:10 +02:00
|
|
|
"fstp %%st" : "=t" (res) : "0" (x));
|
|
|
|
return res;
|
2002-06-13 12:20:48 +02:00
|
|
|
}
|
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE float __cdecl logbf (float x)
|
2002-07-29 05:00:10 +02:00
|
|
|
{
|
|
|
|
float res;
|
2002-08-21 01:26:11 +02:00
|
|
|
__asm__ ("fxtract\n\t"
|
2002-07-29 05:00:10 +02:00
|
|
|
"fstp %%st" : "=t" (res) : "0" (x));
|
|
|
|
return res;
|
|
|
|
}
|
2002-06-13 12:20:48 +02:00
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE long double __cdecl logbl (long double x)
|
2002-07-29 05:00:10 +02:00
|
|
|
{
|
|
|
|
long double res;
|
2002-08-21 01:26:11 +02:00
|
|
|
__asm__ ("fxtract\n\t"
|
2002-07-29 05:00:10 +02:00
|
|
|
"fstp %%st" : "=t" (res) : "0" (x));
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 7.12.6.12 Double in C89 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern float __cdecl modff (float, float*);
|
|
|
|
extern long double __cdecl modfl (long double, long double*);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.6.13 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl scalbn (double, int);
|
|
|
|
extern float __cdecl scalbnf (float, int);
|
|
|
|
extern long double __cdecl scalbnl (long double, int);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl scalbln (double, long);
|
|
|
|
extern float __cdecl scalblnf (float, long);
|
|
|
|
extern long double __cdecl scalblnl (long double, long);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.7.1 */
|
|
|
|
/* Implementations adapted from Cephes versions */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl cbrt (double);
|
|
|
|
extern float __cdecl cbrtf (float);
|
|
|
|
extern long double __cdecl cbrtl (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.7.2 The fabs functions: Double in C89 */
|
2003-05-14 03:03:20 +02:00
|
|
|
extern float __cdecl fabsf (float x);
|
|
|
|
extern long double __cdecl fabsl (long double x);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.7.3 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl hypot (double, double); /* in libmoldname.a */
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE float __cdecl hypotf (float x, float y)
|
2002-08-21 01:26:11 +02:00
|
|
|
{ return (float) hypot (x, y);}
|
2003-02-10 22:13:34 +01:00
|
|
|
extern long double __cdecl hypotl (long double, long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.7.4 The pow functions. Double in C89 */
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE float __cdecl powf (float x, float y)
|
2002-07-29 05:00:10 +02:00
|
|
|
{return (float) pow (x, y);}
|
2003-02-10 22:13:34 +01:00
|
|
|
extern long double __cdecl powl (long double, long double);
|
2002-06-13 12:20:48 +02:00
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
/* 7.12.7.5 The sqrt functions. Double in C89. */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern float __cdecl sqrtf (float);
|
|
|
|
extern long double __cdecl sqrtl (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
2002-11-27 04:41:25 +01:00
|
|
|
/* 7.12.8.1 The erf functions */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl erf (double);
|
|
|
|
extern float __cdecl erff (float);
|
2002-12-08 02:46:42 +01:00
|
|
|
/* TODO
|
2003-02-10 22:13:34 +01:00
|
|
|
extern long double __cdecl erfl (long double);
|
2002-12-08 02:46:42 +01:00
|
|
|
*/
|
|
|
|
|
2002-11-27 04:41:25 +01:00
|
|
|
/* 7.12.8.2 The erfc functions */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl erfc (double);
|
|
|
|
extern float __cdecl erfcf (float);
|
2002-12-08 02:46:42 +01:00
|
|
|
/* TODO
|
2003-02-10 22:13:34 +01:00
|
|
|
extern long double __cdecl erfcl (long double);
|
2002-12-08 02:46:42 +01:00
|
|
|
*/
|
2002-11-27 04:41:25 +01:00
|
|
|
|
|
|
|
/* 7.12.8.3 The lgamma functions */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl lgamma (double);
|
|
|
|
extern float __cdecl lgammaf (float);
|
|
|
|
extern long double __cdecl lgammal (long double);
|
2002-11-27 04:41:25 +01:00
|
|
|
|
2003-01-26 08:04:04 +01:00
|
|
|
/* 7.12.8.4 The tgamma functions */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl tgamma (double);
|
|
|
|
extern float __cdecl tgammaf (float);
|
|
|
|
extern long double __cdecl tgammal (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.9.1 Double in C89 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern float __cdecl ceilf (float);
|
|
|
|
extern long double __cdecl ceill (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.9.2 Double in C89 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern float __cdecl floorf (float);
|
|
|
|
extern long double __cdecl floorl (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.9.3 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl nearbyint ( double);
|
|
|
|
extern float __cdecl nearbyintf (float);
|
|
|
|
extern long double __cdecl nearbyintl (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.9.4 */
|
2002-06-13 12:20:48 +02:00
|
|
|
/* round, using fpu control word settings */
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE double __cdecl rint (double x)
|
2002-06-13 12:20:48 +02:00
|
|
|
{
|
|
|
|
double retval;
|
|
|
|
__asm__ ("frndint;": "=t" (retval) : "0" (x));
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE float __cdecl rintf (float x)
|
2002-06-13 12:20:48 +02:00
|
|
|
{
|
|
|
|
float retval;
|
|
|
|
__asm__ ("frndint;" : "=t" (retval) : "0" (x) );
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE long double __cdecl rintl (long double x)
|
2002-06-13 12:20:48 +02:00
|
|
|
{
|
|
|
|
long double retval;
|
|
|
|
__asm__ ("frndint;" : "=t" (retval) : "0" (x) );
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
/* 7.12.9.5 */
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE long __cdecl lrint (double x)
|
2002-07-29 05:00:10 +02:00
|
|
|
{
|
|
|
|
long retval;
|
|
|
|
__asm__ __volatile__ \
|
|
|
|
("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE long __cdecl lrintf (float x)
|
2002-07-29 05:00:10 +02:00
|
|
|
{
|
|
|
|
long retval;
|
|
|
|
__asm__ __volatile__ \
|
|
|
|
("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE long __cdecl lrintl (long double x)
|
2002-07-29 05:00:10 +02:00
|
|
|
{
|
|
|
|
long retval;
|
|
|
|
__asm__ __volatile__ \
|
|
|
|
("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE long long __cdecl llrint (double x)
|
2002-07-29 05:00:10 +02:00
|
|
|
{
|
|
|
|
long long retval;
|
|
|
|
__asm__ __volatile__ \
|
|
|
|
("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE long long __cdecl llrintf (float x)
|
2002-07-29 05:00:10 +02:00
|
|
|
{
|
|
|
|
long long retval;
|
|
|
|
__asm__ __volatile__ \
|
|
|
|
("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE long long __cdecl llrintl (long double x)
|
2002-07-29 05:00:10 +02:00
|
|
|
{
|
|
|
|
long long retval;
|
|
|
|
__asm__ __volatile__ \
|
|
|
|
("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 7.12.9.6 */
|
2002-06-13 12:20:48 +02:00
|
|
|
/* round away from zero, regardless of fpu control word settings */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl round (double);
|
|
|
|
extern float __cdecl roundf (float);
|
|
|
|
extern long double __cdecl roundl (long double);
|
2002-06-13 12:20:48 +02:00
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
/* 7.12.9.7 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern long __cdecl lround (double);
|
|
|
|
extern long __cdecl lroundf (float);
|
|
|
|
extern long __cdecl lroundl (long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
2003-02-10 22:13:34 +01:00
|
|
|
extern long long __cdecl llround (double);
|
|
|
|
extern long long __cdecl llroundf (float);
|
|
|
|
extern long long __cdecl llroundl (long double);
|
2002-06-13 12:20:48 +02:00
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
/* 7.12.9.8 */
|
2002-06-13 12:20:48 +02:00
|
|
|
/* round towards zero, regardless of fpu control word settings */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl trunc (double);
|
|
|
|
extern float __cdecl truncf (float);
|
|
|
|
extern long double __cdecl truncl (long double);
|
2002-06-13 12:20:48 +02:00
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
/* 7.12.10.1 Double in C89 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern float __cdecl fmodf (float, float);
|
|
|
|
extern long double __cdecl fmodl (long double, long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.10.2 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl remainder (double, double);
|
|
|
|
extern float __cdecl remainderf (float, float);
|
|
|
|
extern long double __cdecl remainderl (long double, long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.10.3 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl remquo(double, double, int *);
|
|
|
|
extern float __cdecl remquof(float, float, int *);
|
|
|
|
extern long double __cdecl remquol(long double, long double, int *);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.11.1 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl copysign (double, double); /* in libmoldname.a */
|
|
|
|
extern float __cdecl copysignf (float, float);
|
|
|
|
extern long double __cdecl copysignl (long double, long double);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.11.2 Return a NaN */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl nan(const char *tagp);
|
|
|
|
extern float __cdecl nanf(const char *tagp);
|
|
|
|
extern long double __cdecl nanl(const char *tagp);
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
#ifndef __STRICT_ANSI__
|
|
|
|
#define _nan() nan("")
|
|
|
|
#define _nanf() nanf("")
|
|
|
|
#define _nanl() nanl("")
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* 7.12.11.3 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl nextafter (double, double); /* in libmoldname.a */
|
|
|
|
extern float __cdecl nextafterf (float, float);
|
2002-07-29 05:00:10 +02:00
|
|
|
/* TODO: Not yet implemented */
|
2003-02-10 22:13:34 +01:00
|
|
|
/* extern long double __cdecl nextafterl (long double, long double); */
|
2002-07-29 05:00:10 +02:00
|
|
|
|
|
|
|
/* 7.12.11.4 The nexttoward functions: TODO */
|
|
|
|
|
|
|
|
/* 7.12.12.1 */
|
|
|
|
/* x > y ? (x - y) : 0.0 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl fdim (double x, double y);
|
|
|
|
extern float __cdecl fdimf (float x, float y);
|
|
|
|
extern long double __cdecl fdiml (long double x, long double y);
|
2002-06-13 12:20:48 +02:00
|
|
|
|
|
|
|
/* fmax and fmin.
|
|
|
|
NaN arguments are treated as missing data: if one argument is a NaN
|
|
|
|
and the other numeric, then these functions choose the numeric
|
|
|
|
value. */
|
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
/* 7.12.12.2 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl fmax (double, double);
|
|
|
|
extern float __cdecl fmaxf (float, float);
|
|
|
|
extern long double __cdecl fmaxl (long double, long double);
|
2002-06-13 12:20:48 +02:00
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
/* 7.12.12.3 */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl fmin (double, double);
|
|
|
|
extern float __cdecl fminf (float, float);
|
|
|
|
extern long double __cdecl fminl (long double, long double);
|
2002-06-13 12:20:48 +02:00
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
/* 7.12.13.1 */
|
2002-06-13 12:20:48 +02:00
|
|
|
/* return x * y + z as a ternary op */
|
2003-02-10 22:13:34 +01:00
|
|
|
extern double __cdecl fma (double, double, double);
|
|
|
|
extern float __cdecl fmaf (float, float, float);
|
|
|
|
extern long double __cdecl fmal (long double, long double, long double);
|
2002-06-13 12:20:48 +02:00
|
|
|
|
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
/* 7.12.14 */
|
|
|
|
/*
|
|
|
|
* With these functions, comparisons involving quiet NaNs set the FP
|
|
|
|
* condition code to "unordered". The IEEE floating-point spec
|
|
|
|
* dictates that the result of floating-point comparisons should be
|
|
|
|
* false whenever a NaN is involved, with the exception of the != op,
|
|
|
|
* which always returns true: yes, (NaN != NaN) is true).
|
|
|
|
*/
|
2002-06-13 12:20:48 +02:00
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
#if __GNUC__ >= 3
|
2002-06-13 12:20:48 +02:00
|
|
|
|
2002-07-29 05:00:10 +02:00
|
|
|
#define isgreater(x, y) __builtin_isgreater(x, y)
|
|
|
|
#define isgreaterequal(x, y) __builtin_isgreaterequal(x, y)
|
|
|
|
#define isless(x, y) __builtin_isless(x, y)
|
|
|
|
#define islessequal(x, y) __builtin_islessequal(x, y)
|
|
|
|
#define islessgreater(x, y) __builtin_islessgreater(x, y)
|
|
|
|
#define isunordered(x, y) __builtin_isunordered(x, y)
|
|
|
|
|
|
|
|
#else
|
|
|
|
/* helper */
|
2003-09-24 02:41:01 +02:00
|
|
|
__CRT_INLINE int __cdecl
|
2002-07-29 05:00:10 +02:00
|
|
|
__fp_unordered_compare (long double x, long double y){
|
|
|
|
unsigned short retval;
|
|
|
|
__asm__ ("fucom %%st(1);"
|
|
|
|
"fnstsw;": "=a" (retval) : "t" (x), "u" (y));
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define isgreater(x, y) ((__fp_unordered_compare(x, y) \
|
|
|
|
& 0x4500) == 0)
|
|
|
|
#define isless(x, y) ((__fp_unordered_compare (y, x) \
|
|
|
|
& 0x4500) == 0)
|
|
|
|
#define isgreaterequal(x, y) ((__fp_unordered_compare (x, y) \
|
|
|
|
& FP_INFINITE) == 0)
|
|
|
|
#define islessequal(x, y) ((__fp_unordered_compare(y, x) \
|
|
|
|
& FP_INFINITE) == 0)
|
|
|
|
#define islessgreater(x, y) ((__fp_unordered_compare(x, y) \
|
|
|
|
& FP_SUBNORMAL) == 0)
|
|
|
|
#define isunordered(x, y) ((__fp_unordered_compare(x, y) \
|
|
|
|
& 0x4500) == 0x4500)
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __STDC_VERSION__ >= 199901L */
|
|
|
|
#endif /* __NO_ISOCEXT */
|
2002-06-13 12:20:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2000-02-17 20:38:33 +01:00
|
|
|
#endif /* Not RC_INVOKED */
|
|
|
|
|
2002-06-13 12:20:48 +02:00
|
|
|
|
2000-02-17 20:38:33 +01:00
|
|
|
#endif /* Not _MATH_H_ */
|