/*
* math.h
* This file has no copyright assigned and is placed in the Public Domain.
* This file is a part of the mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within the package.
*
* Mathematical functions.
*
*/
#ifndef _MATH_H_
#define _MATH_H_
#if __GNUC__ >= 3
#pragma GCC system_header
#endif
/* 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__
#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__ */
/* 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
/* These are also defined in Mingw float.h; needed here as well to work
around GCC build issues. */
#ifndef __STRICT_ANSI__
#ifndef __MINGW_FPCLASS_DEFINED
#define __MINGW_FPCLASS_DEFINED 1
/* IEEE 754 classication */
#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 */
#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.
*/
#if __MINGW_GNUC_PREREQ(3, 3)
#define HUGE_VAL __builtin_huge_val()
#else
#ifndef __DECLSPEC_SUPPORTED
#ifdef __MSVCRT__
extern double* _imp___HUGE;
#define HUGE_VAL (*_imp___HUGE)
#else
/* CRTDLL */
extern double* _imp___HUGE_dll;
#define HUGE_VAL (*_imp___HUGE_dll)
#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 */
#endif /* __MINGW_GNUC_PREREQ(3, 3) */
struct _exception
{
int type;
char *name;
double arg1;
double arg2;
double retval;
};
_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);
_CRTIMP double __cdecl pow (double, double);
_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);
/* Excess precision when using a 64-bit mantissa for FPU math ops can
cause unexpected results with some of the MSVCRT math functions. For
example, unless the function return value is stored (truncating to
53-bit mantissa), calls to pow with both x and y as integral values
sometimes produce a non-integral result.
One workaround is to reset the FPU env to 53-bit mantissa
by a call to fesetenv (FE_PC53_ENV). Amother is to force storage
of the return value of individual math functions using wrappers.
NB, using these wrappers will disable builtin math functions and
hence disable the folding of function results at compile time when
arguments are constant. */
#if 0
#define __DEFINE_FLOAT_STORE_MATHFN_D1(fn1) \
static __inline__ double \
__float_store_ ## fn1 (double x) \
{ \
__volatile__ double res = (fn1) (x); \
return res; \
}
#define __DEFINE_FLOAT_STORE_MATHFN_D2(fn2) \
static __inline__ double \
__float_store_ ## fn2 (double x, double y) \
{ \
__volatile__ double res = (fn2) (x, y); \
return res; \
}
#endif
/* For example, here is how to force the result of the pow function
to be stored: */
#if 0
#undef pow
/* Define the ___float_store_pow function and use it instead of pow(). */
__DEFINE_FLOAT_STORE_MATHFN_D2 (pow)
#define pow __float_store_pow
#endif
#ifndef __STRICT_ANSI__
/* Complex number (for _cabs). This is the MS version. The ISO
C99 counterpart _Complex is an intrinsic type in GCC and
'complex' is defined as a macro. See complex.h */
struct _complex
{
double x; /* Real part */
double y; /* Imaginary part */
};
_CRTIMP double __cdecl _cabs (struct _complex);
_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 *);
/* 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
*/
_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);
_CRTIMP int __cdecl _finite (double);
_CRTIMP int __cdecl _fpclass (double);
_CRTIMP int __cdecl _isnan (double);
/* END FLOAT.H COPY */
/*
* Non-underscored versions of non-ANSI functions.
* These reside in liboldnames.a.
*/
#if !defined (_NO_OLDNAMES)
_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 double __cdecl chgsign (double);
_CRTIMP double __cdecl scalb (double, long);
_CRTIMP int __cdecl finite (double);
_CRTIMP int __cdecl fpclass (double);
#define FP_SNAN _FPCLASS_SNAN
#define FP_QNAN _FPCLASS_QNAN
#define FP_NINF _FPCLASS_NINF
#define FP_PINF _FPCLASS_PINF
#define FP_NDENORM _FPCLASS_ND
#define FP_PDENORM _FPCLASS_PD
#define FP_NZERO _FPCLASS_NZ
#define FP_PZERO _FPCLASS_PZ
#define FP_NNORM _FPCLASS_NN
#define FP_PNORM _FPCLASS_PN
#endif /* Not _NO_OLDNAMES */
/* This require msvcr70.dll or higher. */
#if __MSVCRT_VERSION__ >= 0x0700
_CRTIMP int __cdecl _set_SSE2_enable (int);
#endif /* __MSVCRT_VERSION__ >= 0x0700 */
#endif /* __STRICT_ANSI__ */
#ifndef __NO_ISOCEXT
#if
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
mingw-runtime-3.12.tar.gz (93个子文件)
man
man3
basename.3 9KB
dirname.3 9KB
bin
mingwm10.dll 16KB
include
io.h 10KB
complex.h 6KB
stdlib.h 16KB
excpt.h 3KB
string.h 7KB
share.h 800B
values.h 126B
signal.h 3KB
assert.h 1KB
inttypes.h 5KB
setjmp.h 1KB
search.h 2KB
getopt.h 3KB
unistd.h 719B
profile.h 3KB
wctype.h 5KB
utime.h 23B
mem.h 101B
fcntl.h 2KB
varargs.h 186B
locale.h 2KB
ctype.h 9KB
math.h 24KB
profil.h 1KB
wchar.h 16KB
mbctype.h 2KB
mbstring.h 6KB
dos.h 2KB
errno.h 3KB
conio.h 1KB
tchar.h 11KB
limits.h 3KB
time.h 6KB
process.h 5KB
dir.h 739B
gmon.h 5KB
dirent.h 3KB
float.h 5KB
stdint.h 5KB
direct.h 2KB
malloc.h 3KB
memory.h 126B
strings.h 306B
libgen.h 661B
fenv.h 3KB
sys
param.h 476B
unistd.h 106B
file.h 123B
utime.h 2KB
fcntl.h 116B
timeb.h 1KB
stat.h 5KB
locking.h 818B
time.h 1KB
types.h 2KB
_mingw.h 5KB
stdio.h 15KB
doc
mingw-runtime
DISCLAIMER 519B
README 398B
CONTRIBUTORS 1KB
lib
libmsvcr80.a 542KB
libcrtdll.a 349KB
txtmode.o 322B
CRT_noglob.o 317B
dllcrt2.o 1KB
libmsvcr71d.a 536KB
libmoldnamed.a 81KB
crtmt.o 322B
libcoldname.a 79KB
crt1.o 2KB
libmingwthrd.a 3KB
dllcrt1.o 1KB
libmingwex.a 267KB
CRT_fp10.o 368B
binmode.o 322B
libmsvcr70d.a 522KB
gcrt1.o 692B
libmsvcr71.a 535KB
libgmon.a 5KB
libmoldname.a 81KB
gcrt2.o 692B
libm.a 458B
libmsvcrtd.a 492KB
libmsvcr70.a 521KB
crtst.o 306B
libmsvcr80d.a 543KB
libmingw32.a 7KB
libmsvcrt.a 492KB
crt2.o 2KB
CRT_fp8.o 412B
共 93 条
- 1
资源评论
mzm008
- 粉丝: 0
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功