math.h

math.h

math.h一般見於C程式設計,#include<math.h> 是包含math頭檔案的意思, .h是頭檔案的擴展名(header file),這一句聲明了本程式要用到標準庫中的 math.h檔案。math.h頭檔案中聲明了常用的一些數學運算,比如乘方,開方運算等等,這些頭檔案還有很多,都存放在VC軟體的安裝目錄下。

基本介紹

  • 中文名:math.h
  • 來源:C程式設計
  • 意義:包含math頭檔案
  • 作用:聲明了常用的一些數學運算
所包含的函式,注意事項,內容,

所包含的函式

數學函式館,一些數學計算公式的具體實現是放在math.h里,具體有:
1、 三角函式
double sin(double);正弦
double cos(double);餘弦
double tan(double);正切
2 、反三角函式
double asin (double); 結果介於[-PI/2,PI/2]
double acos (double); 結果介於[0,PI]
double atan (double); 反正切(主值),結果介於[-PI/2,PI/2]
double atan2 (double,double); 反正切(整圓值),結果介於[-PI,PI]
3 、雙曲三角函式
double sinh (double);
double cosh (double);
double tanh (double);
4 、指數與對數
double frexp(double value,int *exp);這是一個將value值拆分成小數部分f和(以2為底的)指數部分exp,並返回小數部分f,即f*2^exp。其中f取值在0.5~1.0範圍或者0。
double ldexp(double x,int exp);這個函式剛好跟上面那個frexp函式功能相反,它的返回值是x*2^exp
double modf(double value,double *iptr);拆分value值,返回它的小數部分,iptr指向整數部分。
double log (double); 以e為底的對數
double log10 (double);以10為底的對數
double pow(double x,double y);計算x的y次冪
float powf(float x,float y); 功能與pow一致,只是輸入與輸出皆為單精度浮點數
double exp (double);求取自然數e的冪
double sqrt (double);開平方根
5 、取整
double ceil (double); 取上整,返回不比x小的最小整數
double floor (double); 取下整,返回不比x大的最大整數,即高斯函式[x]
6 、絕對值
double fabs (double);求實型的絕對值
double cabs(struct complex znum);求複數的絕對值
7 、標準化浮點數
double frexp (double f,int *p); 標準化浮點數,f = x * 2^p,已知f求x,p (x介於[0.5,1])
double ldexp (double x,int p); 與frexp相反,已知x,p求f
8 、取整與取余
double modf (double,double*); 將參數的整數部分通過指針回傳,返回小數部分
double fmod (double,double); 返回兩參數相除的餘數
9 、其他
double hypot(double x,double y);已知直角三角形兩個直角邊長度,求斜邊長度
double ldexp(double x,int exponent);計算x*(2的指數冪)
double poly(double x,int degree,double coeffs []);計算多項式
int matherr(struct exception *e);數學錯誤計算處理程式
source: 《C & C++ Code Capsules》

注意事項

  1. 沒有現成的cot三角函式,可以使用tan(PI/2-x)來實現
  2. double atan2(double y,double x);取值範圍在(PI,PI)之間;這是一個不太常見的函式,主要用來返回y/x的反正切值。
  3. 強調一點,1-3類 傳參都是針對以弧度表示的數值,非角度表示的數值。
  4. 對於一般的對數求解,考慮利用數學上的對數轉換來實現。
  5. 關於fmod:考慮到%只適用與整型數據,這裡提出一個專門針對實型數據的取余運算的函式。
  6. int rand(void) 用這函式的時候記得要給隨機種子喔,要不得出的不是真正的隨機數.產生隨機種子可以用srand((unsigned int)time(NULL));這就是由時間產生的隨機種子了。
  7. 在gcc中,需要使用-lm連結math庫檔案方可使用。

內容

此檔案為VS++2010中\Microsoft Visual Studio 10.0\VC\crt\src目錄下math.h的內容。VS2010中\Microsoft Visual Studio 10.0\VC\include下也有一個math.h。
/****math.h-definitionsanddeclarationsformathlibrary**Copyright(c)MicrosoftCorporation.Allrightsreserved.**Purpose:*Thisfilecontainsconstantdefinitionsandexternalsubroutine*declarationsforthemathsubroutinelibrary.*[ANSI/SystemV]**[Public]*****/#ifndef_INC_MATH#define_INC_MATH#include<crtdefs.h>/**Currently,allMSCcompilersforWin32platformsdefaultto8byte*alignment.*/#pragmapack(push,_CRT_PACKING)#ifdef__cplusplusextern"C"{#endif/*__cplusplus*/#ifndef__assembler/*Definitionof_exceptionstruct-thisstructispassedtothematherr*routinewhenafloatingpointexceptionisdetected*/#ifndef_EXCEPTION_DEFINEDstruct_exception{inttype;/*exceptiontype-seebelow*/char*name;/*nameoffunctionwhereerroroccured*/doublearg1;/*firstargumenttofunction*/doublearg2;/*secondargument(ifany)tofunction*/doubleretval;/*valuetobereturnedbyfunction*/};#define_EXCEPTION_DEFINED#endif/*_EXCEPTION_DEFINED*//*Definitionofa_complexstructtobeusedbythosewhousecabsand*wanttypecheckingontheirargument*/#ifndef_COMPLEX_DEFINEDstruct_complex{doublex,y;/*realandimaginaryparts*/};#if!__STDC__&&!defined(__cplusplus)/*Non-ANSInameforcompatibility*/#definecomplex_complex#endif/*!__STDC__&&!defined(__cplusplus)*/#define_COMPLEX_DEFINED#endif/*_COMPLEX_DEFINED*/#endif/*__assembler*//*Constantdefinitionsfortheexceptiontypepassedinthe_exceptionstruct*/#define_DOMAIN1/*argumentdomainerror*/#define_SING2/*argumentsingularity*/#define_OVERFLOW3/*overflowrangeerror*/#define_UNDERFLOW4/*underflowrangeerror*/#define_TLOSS5/*totallossofprecision*/#define_PLOSS6/*partiallossofprecision*/#defineEDOM33#defineERANGE34/*Definitionsof_HUGEandHUGE_VAL-respectivelytheXENⅨandANSInames*foravaluereturnedincaseoferrorbyanumberofthefloatingpoint*mathroutines*/#ifndef__assembler#if!defined(_M_CEE_PURE)_CRTIMPexterndouble_HUGE;#else/*!defined(_M_CEE_PURE)*/constdouble_HUGE=System::Double::PositiveInfinity;#endif/*!defined(_M_CEE_PURE)*/#endif/*__assembler*/#defineHUGE_VAL_HUGE/*Functionprototypes*/#if!defined(__assembler)#ifndef_CRT_ABS_DEFINED#define_CRT_ABS_DEFINEDint__cdeclabs(_In_int_X);long__cdecllabs(_In_long_X);longlong__cdeclllabs(_In_longlong_X);#endif/*_CRT_ABS_DEFINED*/double__cdeclacos(_In_double_X);double__cdeclasin(_In_double_X);double__cdeclatan(_In_double_X);double__cdeclatan2(_In_double_Y,_In_double_X);#ifndef_SIGN_DEFINED_Check_return__CRTIMPdouble__cdecl_copysign(_In_double_Number,_In_double_Sign);_Check_return__CRTIMPdouble__cdecl_chgsign(_In_double_X);#define_SIGN_DEFINED#endif/*_SIGN_DEFINED*/double__cdeclcos(_In_double_X);double__cdeclcosh(_In_double_X);double__cdeclexp(_In_double_X);_CRT_JIT_INTRINSICdouble__cdeclfabs(_In_double_X);double__cdeclfmod(_In_double_X,_In_double_Y);double__cdecllog(_In_double_X);double__cdecllog10(_In_double_X);double__cdeclpow(_In_double_X,_In_double_Y);double__cdeclsin(_In_double_X);double__cdeclsinh(_In_double_X);double__cdecltan(_In_double_X);double__cdecltanh(_In_double_X);double__cdeclsqrt(_In_double_X);#ifndef_CRT_ATOF_DEFINED#define_CRT_ATOF_DEFINED_Check_return__CRTIMPdouble__cdeclatof(_In_z_constchar*_String);_Check_return__CRTIMPdouble__cdecl_atof_l(_In_z_constchar*_String,_In_opt__locale_t_Locale);#endif/*_CRT_ATOF_DEFINED*/_CRTIMPdouble__cdecl_cabs(_In_struct_complex_Complex_value);_CRTIMPdouble__cdeclceil(_In_double_X);_CRTIMPdouble__cdeclfloor(_In_double_X);_CRTIMPdouble__cdeclfrexp(_In_double_X,_Out_int*_Y);_CRTIMPdouble__cdecl_hypot(_In_double_X,_In_double_Y);_CRTIMPfloat__cdecl_hypotf(_In_float_X,_In_float_Y);_CRTIMPdouble__cdecl_j0(_In_double_X);_CRTIMPdouble__cdecl_j1(_In_double_X);_CRTIMPdouble__cdecl_jn(int_X,_In_double_Y);_CRTIMPdouble__cdeclldexp(_In_double_X,_In_int_Y);#ifndef_CRT_MATHERR_DEFINED#define_CRT_MATHERR_DEFINED#ifdefined(MRTDLL)||defined(_M_CEE_PURE)int__CRTDECL_matherr(_Inout_struct_exception*_Except);#else/*defined(MRTDLL)||defined(_M_CEE_PURE)*/int__cdecl_matherr(_Inout_struct_exception*_Except);#endif/*defined(MRTDLL)||defined(_M_CEE_PURE)*/#endif/*_CRT_MATHERR_DEFINED*/_CRTIMPdouble__cdeclmodf(_In_double_X,_Out_double*_Y);_CRTIMPdouble__cdecl_y0(_In_double_X);_CRTIMPdouble__cdecl_y1(_In_double_X);_CRTIMPdouble__cdecl_yn(_In_int_X,_In_double_Y);/*hypotandhypotfarenowpartoftheC99Standard*/#if!defined(RC_INVOKED)&&!defined(__midl)static__inlinedouble__CRTDECLhypot(_In_double_X,_In_double_Y){return_hypot(_X,_Y);}static__inlinefloat__CRTDECLhypotf(_In_float_X,_In_float_Y){return_hypotf(_X,_Y);}#endif/*!defined(RC_INVOKED)&&!defined(__midl)*/#ifdefined(_M_Ⅸ86)_CRTIMPint__cdecl_set_SSE2_enable(_In_int_Flag);#endif/*defined(_M_Ⅸ86)*/#ifdefined(_M_IA64)/*ANSIC,4.5Mathematics*//*4.5.2Trigonometricfunctions*/_CRTIMPfloat__cdeclacosf(_In_float_X);_CRTIMPfloat__cdeclasinf(_In_float_X);_CRTIMPfloat__cdeclatanf(_In_float_X);_CRTIMPfloat__cdeclatan2f(_In_float_Y,float_X);_CRTIMPfloat__cdeclcosf(_In_float_X);_CRTIMPfloat__cdeclsinf(_In_float_X);_CRTIMPfloat__cdecltanf(_In_float_X);/*4.5.3Hyperbolicfunctions*/_CRTIMPfloat__cdeclcoshf(_In_float_X);_CRTIMPfloat__cdeclsinhf(_In_float_X);_CRTIMPfloat__cdecltanhf(_In_float_X);/*4.5.4Exponentialandlogarithmicfunctions*/_CRTIMPfloat__cdeclexpf(_In_float_X);_CRTIMPfloat__cdecllogf(_In_float_X);_CRTIMPfloat__cdecllog10f(_In_float_X);_CRTIMPfloat__cdeclmodff(float_X,_Out_float*_Y);/*4.5.5Powerfunctions*/_CRTIMPfloat__cdeclpowf(_In_float_Base,_In_float_Exp);_CRTIMPfloat__cdeclsqrtf(_In_float_X);/*4.5.6Nearestinteger,absolutevalue,andremainderfunctions*/_CRTIMPfloat__cdeclceilf(_In_float_X);_CRT_JIT_INTRINSIC_CRTIMPfloat__cdeclfabsf(_In_float_X);_CRTIMPfloat__cdeclfloorf(_In_float_X);_CRTIMPfloat__cdeclfmodf(_In_float_X,_In_float_Y);_CRTIMPfloat__cdeclldexpf(_In_float_X,_In_int_Y);#endif/*defined(_M_IA64)*/#ifdefined(_M_AMD64)/*ANSIC,4.5Mathematics*//*4.5.2Trigonometricfunctions*/_CRTIMPfloat__cdeclacosf(_In_float_X);_CRTIMPfloat__cdeclasinf(_In_float_X);_CRTIMPfloat__cdeclatanf(_In_float_X);_CRTIMPfloat__cdeclatan2f(_In_float_Y,_In_float_X);_CRTIMPfloat__cdeclcosf(_In_float_X);_CRTIMPfloat__cdeclsinf(_In_float_X);_CRTIMPfloat__cdecltanf(_In_float_X);/*4.5.3Hyperbolicfunctions*/_CRTIMPfloat__cdeclcoshf(_In_float_X);_CRTIMPfloat__cdeclsinhf(_In_float_X);_CRTIMPfloat__cdecltanhf(_In_float_X);/*4.5.4Exponentialandlogarithmicfunctions*/_CRTIMPfloat__cdeclexpf(_In_float_X);_CRTIMPfloat__cdecllogf(_In_float_X);_CRTIMPfloat__cdecllog10f(_In_float_X);_CRTIMPfloat__cdeclmodff(_In_float_X,_Out_float*_Y);/*4.5.5Powerfunctions*/_CRTIMPfloat__cdeclpowf(_In_float_X,_In_float_Y);_CRTIMPfloat__cdeclsqrtf(_In_float_X);/*4.5.6Nearestinteger,absolutevalue,andremainderfunctions*/_CRTIMPfloat__cdeclceilf(_In_float_X);_CRTIMPfloat__cdeclfloorf(_In_float_X);_CRTIMPfloat__cdeclfmodf(_In_float_X,_In_float_Y);_CRTIMPfloat__cdecl_copysignf(_In_float_Number,_In_float_Sign);_CRTIMPfloat__cdecl_chgsignf(_In_float_X);_CRTIMPfloat__cdecl_logbf(_In_float_X);_CRTIMPfloat__cdecl_nextafterf(_In_float_X,_In_float_Y);_CRTIMPint__cdecl_finitef(_In_float_X);_CRTIMPint__cdecl_isnanf(_In_float_X);_CRTIMPint__cdecl_fpclassf(_In_float_X);#endif/*defined(_M_AMD64)*//*Macrosdefininglongdoublefunctionstobetheirdoublecounterparts*(longdoubleissynonymouswithdoubleinthisimplementation).*/#ifndef__cplusplus#defineacosl(x)((longdouble)acos((double)(x)))#defineasinl(x)((longdouble)asin((double)(x)))#defineatanl(x)((longdouble)atan((double)(x)))#defineatan2l(y,x)((longdouble)atan2((double)(y),(double)(x)))#defineceill(x)((longdouble)ceil((double)(x)))#definecosl(x)((longdouble)cos((double)(x)))#definecoshl(x)((longdouble)cosh((double)(x)))#defineexpl(x)((longdouble)exp((double)(x)))#definefabsl(x)((longdouble)fabs((double)(x)))#definefloorl(x)((longdouble)floor((double)(x)))#definefmodl(x,y)((longdouble)fmod((double)(x),(double)(y)))#definefrexpl(x,y)((longdouble)frexp((double)(x),(y)))#define_hypotl(x,y)((longdouble)_hypot((double)(x),(double)(y)))#definehypotl(x,y)((longdouble)_hypot((double)(x),(double)(y)))#defineldexpl(x,y)((longdouble)ldexp((double)(x),(y)))#definelogl(x)((longdouble)log((double)(x)))#definelog10l(x)((longdouble)log10((double)(x)))#define_matherrl_matherr#definemodfl(x,y)((longdouble)modf((double)(x),(double*)(y)))#definepowl(x,y)((longdouble)pow((double)(x),(double)(y)))#definesinl(x)((longdouble)sin((double)(x)))#definesinhl(x)((longdouble)sinh((double)(x)))#definesqrtl(x)((longdouble)sqrt((double)(x)))#definetanl(x)((longdouble)tan((double)(x)))#definetanhl(x)((longdouble)tanh((double)(x)))#define_chgsignl(x)((longdouble)_chgsign((double)(x)))#define_copysignl(x,y)((longdouble)_copysign((double)(x),(double)(y)))#definefrexpf(x,y)((float)frexp((double)(x),(y)))#if!defined(_M_IA64)#definefabsf(x)((float)fabs((double)(x)))#defineldexpf(x,y)((float)ldexp((double)(x),(y)))#if!defined(_M_AMD64)#defineacosf(x)((float)acos((double)(x)))#defineasinf(x)((float)asin((double)(x)))#defineatanf(x)((float)atan((double)(x)))#defineatan2f(y,x)((float)atan2((double)(y),(double)(x)))#defineceilf(x)((float)ceil((double)(x)))#definecosf(x)((float)cos((double)(x)))#definecoshf(x)((float)cosh((double)(x)))#defineexpf(x)((float)exp((double)(x)))#definefloorf(x)((float)floor((double)(x)))#definefmodf(x,y)((float)fmod((double)(x),(double)(y)))#definelogf(x)((float)log((double)(x)))#definelog10f(x)((float)log10((double)(x)))#definemodff(x,y)((float)modf((double)(x),(double*)(y)))#definepowf(x,y)((float)pow((double)(x),(double)(y)))#definesinf(x)((float)sin((double)(x)))#definesinhf(x)((float)sinh((double)(x)))#definesqrtf(x)((float)sqrt((double)(x)))#definetanf(x)((float)tan((double)(x)))#definetanhf(x)((float)tanh((double)(x)))#endif/*!defined(_M_AMD64)*/#endif/*!defined(_M_IA64)*/#else/*__cplusplus*/inlinelongdoubleacosl(_In_longdouble_X){return(acos((double)_X));}inlinelongdoubleasinl(_In_longdouble_X){return(asin((double)_X));}inlinelongdoubleatanl(_In_longdouble_X){return(atan((double)_X));}inlinelongdoubleatan2l(_In_longdouble_Y,_In_longdouble_X){return(atan2((double)_Y,(double)_X));}inlinelongdoubleceill(_In_longdouble_X){return(ceil((double)_X));}inlinelongdoublecosl(_In_longdouble_X){return(cos((double)_X));}inlinelongdoublecoshl(_In_longdouble_X){return(cosh((double)_X));}inlinelongdoubleexpl(_In_longdouble_X){return(exp((double)_X));}inlinelongdoublefabsl(_In_longdouble_X){return(fabs((double)_X));}inlinelongdoublefloorl(_In_longdouble_X){return(floor((double)_X));}inlinelongdoublefmodl(_In_longdouble_X,_In_longdouble_Y){return(fmod((double)_X,(double)_Y));}inlinelongdoublefrexpl(_In_longdouble_X,_Out_int*_Y){return(frexp((double)_X,_Y));}inlinelongdoubleldexpl(_In_longdouble_X,_In_int_Y){return(ldexp((double)_X,_Y));}inlinelongdoublelogl(_In_longdouble_X){return(log((double)_X));}inlinelongdoublelog10l(_In_longdouble_X){return(log10((double)_X));}inlinelongdoublemodfl(_In_longdouble_X,_Out_longdouble*_Y){double_Di,_Df=modf((double)_X,&_Di);*_Y=(longdouble)_Di;return(_Df);}inlinelongdoublepowl(_In_longdouble_X,_In_longdouble_Y){return(pow((double)_X,(double)_Y));}inlinelongdoublesinl(_In_longdouble_X){return(sin((double)_X));}inlinelongdoublesinhl(_In_longdouble_X){return(sinh((double)_X));}inlinelongdoublesqrtl(_In_longdouble_X){return(sqrt((double)_X));}#ifndef_M_IA64inlinelongdoubletanl(_In_longdouble_X){return(tan((double)_X));}#else/*_M_IA64*/_CRTIMPlongdouble__cdecltanl(_In_longdouble_X);#endif/*_M_IA64*/inlinelongdoubletanhl(_In_longdouble_X){return(tanh((double)_X));}inlinelongdouble_chgsignl(_In_longdouble_Number){return_chgsign(static_cast<double>(_Number));}inlinelongdouble_copysignl(_In_longdouble_Number,_In_longdouble_Sign){return_copysign(static_cast<double>(_Number),static_cast<double>(_Sign));}inlinefloatfrexpf(_In_float_X,_Out_int*_Y){return((float)frexp((double)_X,_Y));}#if!defined(_M_IA64)inlinefloatfabsf(_In_float_X){return((float)fabs((double)_X));}inlinefloatldexpf(_In_float_X,_In_int_Y){return((float)ldexp((double)_X,_Y));}#if!defined(_M_AMD64)inlinefloatacosf(_In_float_X){return((float)acos((double)_X));}inlinefloatasinf(_In_float_X){return((float)asin((double)_X));}inlinefloatatanf(_In_float_X){return((float)atan((double)_X));}inlinefloatatan2f(_In_float_Y,_In_float_X){return((float)atan2((double)_Y,(double)_X));}inlinefloatceilf(_In_float_X){return((float)ceil((double)_X));}inlinefloatcosf(_In_float_X){return((float)cos((double)_X));}inlinefloatcoshf(_In_float_X){return((float)cosh((double)_X));}inlinefloatexpf(_In_float_X){return((float)exp((double)_X));}inlinefloatfloorf(_In_float_X){return((float)floor((double)_X));}inlinefloatfmodf(_In_float_X,_In_float_Y){return((float)fmod((double)_X,(double)_Y));}inlinefloatlogf(_In_float_X){return((float)log((double)_X));}inlinefloatlog10f(_In_float_X){return((float)log10((double)_X));}inlinefloatmodff(_In_float_X,_Out_float*_Y){double_Di,_Df=modf((double)_X,&_Di);*_Y=(float)_Di;return((float)_Df);}inlinefloatpowf(_In_float_X,_In_float_Y){return((float)pow((double)_X,(double)_Y));}inlinefloatsinf(_In_float_X){return((float)sin((double)_X));}inlinefloatsinhf(_In_float_X){return((float)sinh((double)_X));}inlinefloatsqrtf(_In_float_X){return((float)sqrt((double)_X));}inlinefloattanf(_In_float_X){return((float)tan((double)_X));}inlinefloattanhf(_In_float_X){return((float)tanh((double)_X));}#endif/*!defined(_M_AMD64)*/#endif/*!defined(_M_IA64)*/#endif/*__cplusplus*/#endif/*!defined(__assembler)*/#if!__STDC__/*Non-ANSInamesforcompatibility*/#defineDOMAIN_DOMAIN#defineSING_SING#defineOVERFLOW_OVERFLOW#defineUNDERFLOW_UNDERFLOW#defineTLOSS_TLOSS#definePLOSS_PLOSS#definematherr_matherr#ifndef__assembler#if!defined(_M_CEE_PURE)_CRTIMPexterndoubleHUGE;#else/*!defined(_M_CEE_PURE)*/constdoubleHUGE=_HUGE;#endif/*!defined(_M_CEE_PURE)*/_CRT_NONSTDC_DEPRECATE(_cabs)_CRTIMPdouble__cdeclcabs(_In_struct_complex_X);_CRT_NONSTDC_DEPRECATE(_j0)_CRTIMPdouble__cdeclj0(_In_double_X);_CRT_NONSTDC_DEPRECATE(_j1)_CRTIMPdouble__cdeclj1(_In_double_X);_CRT_NONSTDC_DEPRECATE(_jn)_CRTIMPdouble__cdecljn(_In_int_X,_In_double_Y);_CRT_NONSTDC_DEPRECATE(_y0)_CRTIMPdouble__cdecly0(_In_double_X);_CRT_NONSTDC_DEPRECATE(_y1)_CRTIMPdouble__cdecly1(_In_double_X);_CRT_NONSTDC_DEPRECATE(_yn)_CRTIMPdouble__cdeclyn(_In_int_X,_In_double_Y);#endif/*__assembler*/#endif/*!__STDC__*/#ifdef__cplusplus}extern"C++"{template<class_Ty>inline_Ty_Pow_int(_Ty_X,int_Y){unsignedint_N;if(_Y>=0)_N=(unsignedint)_Y;else_N=(unsignedint)(-_Y);for(_Ty_Z=_Ty⑴;_X*=_X){if((_N&1)!=0)_Z*=_X;if((_N>>=1)==0)return(_Y<0_Ty⑴/_Z:_Z);}}inlinedouble__CRTDECLabs(_In_double_X){return(fabs(_X));}inlinedouble__CRTDECLpow(_In_double_X,_In_int_Y){return(_Pow_int(_X,_Y));}inlinefloat__CRTDECLabs(_In_float_X){return(fabsf(_X));}inlinefloat__CRTDECLacos(_In_float_X){return(acosf(_X));}inlinefloat__CRTDECLasin(_In_float_X){return(asinf(_X));}inlinefloat__CRTDECLatan(_In_float_X){return(atanf(_X));}inlinefloat__CRTDECLatan2(_In_float_Y,_In_float_X){return(atan2f(_Y,_X));}inlinefloat__CRTDECLceil(_In_float_X){return(ceilf(_X));}inlinefloat__CRTDECLcos(_In_float_X){return(cosf(_X));}inlinefloat__CRTDECLcosh(_In_float_X){return(coshf(_X));}inlinefloat__CRTDECLexp(_In_float_X){return(expf(_X));}inlinefloat__CRTDECLfabs(_In_float_X){return(fabsf(_X));}inlinefloat__CRTDECLfloor(_In_float_X){return(floorf(_X));}inlinefloat__CRTDECLfmod(_In_float_X,_In_float_Y){return(fmodf(_X,_Y));}inlinefloat__CRTDECLfrexp(_In_float_X,_Out_int*_Y){return(frexpf(_X,_Y));}inlinefloat__CRTDECLldexp(_In_float_X,_In_int_Y){return(ldexpf(_X,_Y));}inlinefloat__CRTDECLlog(_In_float_X){return(logf(_X));}inlinefloat__CRTDECLlog10(_In_float_X){return(log10f(_X));}inlinefloat__CRTDECLmodf(_In_float_X,_Out_float*_Y){return(modff(_X,_Y));}inlinefloat__CRTDECLpow(_In_float_X,_In_float_Y){return(powf(_X,_Y));}inlinefloat__CRTDECLpow(_In_float_X,_In_int_Y){return(_Pow_int(_X,_Y));}inlinefloat__CRTDECLsin(_In_float_X){return(sinf(_X));}inlinefloat__CRTDECLsinh(_In_float_X){return(sinhf(_X));}inlinefloat__CRTDECLsqrt(_In_float_X){return(sqrtf(_X));}inlinefloat__CRTDECLtan(_In_float_X){return(tanf(_X));}inlinefloat__CRTDECLtanh(_In_float_X){return(tanhf(_X));}inlinelongdouble__CRTDECLabs(_In_longdouble_X){return(fabsl(_X));}inlinelongdouble__CRTDECLacos(_In_longdouble_X){return(acosl(_X));}inlinelongdouble__CRTDECLasin(_In_longdouble_X){return(asinl(_X));}inlinelongdouble__CRTDECLatan(_In_longdouble_X){return(atanl(_X));}inlinelongdouble__CRTDECLatan2(_In_longdouble_Y,_In_longdouble_X){return(atan2l(_Y,_X));}inlinelongdouble__CRTDECLceil(_In_longdouble_X){return(ceill(_X));}inlinelongdouble__CRTDECLcos(_In_longdouble_X){return(cosl(_X));}inlinelongdouble__CRTDECLcosh(_In_longdouble_X){return(coshl(_X));}inlinelongdouble__CRTDECLexp(_In_longdouble_X){return(expl(_X));}inlinelongdouble__CRTDECLfabs(_In_longdouble_X){return(fabsl(_X));}inlinelongdouble__CRTDECLfloor(_In_longdouble_X){return(floorl(_X));}inlinelongdouble__CRTDECLfmod(_In_longdouble_X,_In_longdouble_Y){return(fmodl(_X,_Y));}inlinelongdouble__CRTDECLfrexp(_In_longdouble_X,_Out_int*_Y){return(frexpl(_X,_Y));}inlinelongdouble__CRTDECLldexp(_In_longdouble_X,_In_int_Y){return(ldexpl(_X,_Y));}inlinelongdouble__CRTDECLlog(_In_longdouble_X){return(logl(_X));}inlinelongdouble__CRTDECLlog10(_In_longdouble_X){return(log10l(_X));}inlinelongdouble__CRTDECLmodf(_In_longdouble_X,_Out_longdouble*_Y){return(modfl(_X,_Y));}inlinelongdouble__CRTDECLpow(_In_longdouble_X,_In_longdouble_Y){return(powl(_X,_Y));}inlinelongdouble__CRTDECLpow(_In_longdouble_X,_In_int_Y){return(_Pow_int(_X,_Y));}inlinelongdouble__CRTDECLsin(_In_longdouble_X){return(sinl(_X));}inlinelongdouble__CRTDECLsinh(_In_longdouble_X){return(sinhl(_X));}inlinelongdouble__CRTDECLsqrt(_In_longdouble_X){return(sqrtl(_X));}inlinelongdouble__CRTDECLtan(_In_longdouble_X){return(tanl(_X));}inlinelongdouble__CRTDECLtanh(_In_longdouble_X){return(tanhl(_X));}}#endif/*__cplusplus*/#pragmapack(pop)#endif/*_INC_MATH*/#ifdefined(_USE_MATH_DEFINES)&&!defined(_MATH_DEFINES_DEFINED)#define_MATH_DEFINES_DEFINED/*Define_USE_MATH_DEFINESbeforeincludingmath.htoexposethesemacro*definitionsforcommonmathconstants.Theseareplacedunderan#ifdef*sincethesecommonly-definednamesarenotpartoftheC/C++standards.*//*Definitionsofusefulmathematicalconstants*M_E-e*M_LOG2E-log2(e)*M_LOG10E-log10(e)*M_LN2-ln⑵*M_LN10-ln⑽*M_PI-pi*M_PI_2-pi/2*M_PI_4-pi/4*M_1_PI-1/pi*M_2_PI-2/pi*M_2_SQRTPI-2/sqrt(pi)*M_SQRT2-sqrt⑵*M_SQRT1_2-1/sqrt⑵*/#defineM_E2.71828182845904523536#defineM_LOG2E1.44269504088896340736#defineM_LOG10E0.434294481903251827651#defineM_LN20.693147180559945309417#defineM_LN102.30258509299404568402#defineM_PI3.141`5`9`2`6`5`3`5`8`979323846(註:圓周率,百度說這事)#defineM_PI_21.57079632679489661923#defineM_PI_40.785398163397448309616#defineM_1_PI0.318309886183790671538#defineM_2_PI0.636619772367581343076#defineM_2_SQRTPI1.12837916709551257390#defineM_SQRT21.41421·3·5·6·2·3·7·309504880(註:百度依然說這是電話號碼)#defineM_SQRT1_20.707106781186547524401#endif/*defined(_USE_MATH_DEFINES)&&!defined(_MATH_DEFINES_DEFINED)*/

相關詞條

熱門詞條

聯絡我們