The math.h header file contains function declarations for all the floating-point math functions:
No feature test macro required.
absf() | absl() | acos() | acosf() | acoshf() |
acoshl() | acosl() | asin() | asinf() | asinhf() |
asinhl() | asinl() | atan() | atan2() | atan2f() |
atan2l() | atanf() | atanl() | cbrtf() | cbrtl() |
ceil() | ceilf() | ceill() | copysign() | copysignf() |
copysignl() | cos() | cosf() | cosh() | coshf() |
coshl() | cosl() | exp() | expf() | expl() |
expm1f() | expm1l() | exp2() | exp2f() | exp2l() |
fabsf() | fabsl() | floor() | floorf() | floorl() |
fma() | fmaf() | fmal() | fmax() | fmaxf() |
fmaxl() | fmin() | fminf() | fminl() | fmod() |
fmodf() | fmodl() | frexp() | frexpf() | frexpl() |
hypotf() | hypotl() | ilogbf() | ilogbl() | ldexp() |
ldexpf() | ldexpl() | lgammaf() | lgammal() | llrint() |
llrintf() | llrintl() | llround() | llroundf() | llroundl() |
log() | logbf() | logbl() | logf() | logl() |
log1pf() | log1pl() | log10() | log10f() | log10l() |
lrint() | lrintf() | lrintl() | lround() | lroundf() |
lroundl() | modf() | modff() | modfl() | nan() |
nanf() | nanl() | nearbyint() | nearbyintf() | nearbyintl() |
nextafterf() | nextafterl() | nexttoward() | nexttowardf() | nexttowardl() |
pow() | powf() | powl() | remainderf() | remainderl() |
remquo() | remquof() | remquol( ) | rintf() | rintl() |
round() | roundf() | roundl() | scalbln() | scalblnf() |
scalblnl() | sin() | sinf() | sinh() | sinhf() |
sinhl() | sinl() | sqrt() | sqrtf() | sqrtl() |
tan() | tanf() | tanh() | tanhf() | tanhl() |
tanl() | tgamma() | tgammaf() | tgammal() |
erf() | erfc() | gamma() | hypot() | isnan() |
jn() | j0() | j1() | lgamma() | yn() |
y0() | y1() |
acosh() | asinh() | atanh() | cbrt() | expm1() |
ilogb() | logb() | log1p() | nextafter() | remainder() |
rint() | scalb() |
acosd32() | acosd64() | acosd128() | acoshd32() | acoshd64() |
acoshd128() | asind32() | asind64() | asind128() | asinhd32() |
asinhd64() | asinhd128() | atand32() | atand64() | atand128() |
atan2d32() | atan2d64() | atan2d128() | atanhd32() | atanhd64() |
atanhd128() | __atanpid32() | __atanpid64() | __atanpid128() | cbrtd32() |
cbrtd64() | cbrtd128() | ceild32() | ceild64() | ceild128() |
copysignd32() | copysignd64() | copysignd128() | cosd32() | cosd64() |
cosd128() | coshd32() | coshd64() | coshd128() | __cospid32() |
__cospid64() | __cospid128() | erfd32() | erfd64() | erfd128() |
erfcd32() | erfcd64() | erfcd128() | expd32() | expd64() |
expd128() | expm1d32() | expm1d64() | expm1d128() | exp2d32() |
exp2d64() | exp2d128() | fabsd32() | fabsd64() | fabsd128() |
fdimd32() | fdimd64() | fdimd128() | floord32() | floord64() |
floord128() | fmad32() | fmad64() | fmad128() | fmaxd32() |
fmaxd64() | fmaxd128() | fmind32() | fmind64() | fmind128() |
fmodd32() | fmodd64() | fmodd128() | frexpd32() | frexpd64() |
frexpd128() | hypotd32() | hypotd64() | hypotd128() | ilogbd32() |
ilogbd64() | ilogbd128() | ldexpd32() | ldexpd64() | ldexpd128() |
lgammad32() | lgammad64() | lgammad128() | llrintd32() | llrintd64() |
llrintd128() | llroundd32() | llroundd64() | llroundd128() | logd32() |
logd64() | logd128() | log1pd32() | log1pd64() | log1pd128() |
log2d32() | log2d64() | log2d128() | log10d32() | log10d64() |
log10d128() | logbd32() | logbd64() | logbd128() | lrintd32() |
lrintd64() | lrintd128() | lroundd32() | lroundd64() | lroundd128() |
modfd32() | modfd64() | modfd128() | nand32() | nand64() |
nand128() | nearbyintd32() | nearbyintd64() | nearbyintd128() | nextafterd32() |
nextafterd64() | nextafterd128() | nexttowardd32() | nexttowardd64() | nexttowardd128() |
powd32() | powd64() | powd128() | quantexpd32() | quantexpd64() |
quantexpd128() | quantized32() | quantized64() | quantized128() | remainderd32() |
remainderd64() | remainderd128() | __remquod32() | __remquod64() | __remquod128() |
rintd32() | rintd64() | rintd128() | roundd32() | roundd64() |
roundd128() | samequantumd32() | samequantumd64() | samequantumd128() | scalblnd32() |
scalblnd64() | scalblnd128() | scalbnd32() | scalbnd64() | scalbnd128() |
sind32() | sind64() | sind128() | sinhd32() | sinhd64() |
sinhd128() | __sinpid32() | __sinpid64() | __sinpid128() | sqrtd32() |
sqrtd64() | sqrtd128() | tand32() | tand64() | tand128() |
tanhd32() | tanhd64() | tanhd128() | tgammad32() | tgammad64() |
tgammad128() | truncd32() | truncd64() | truncd128() |
abs() | acos() | acosh() | asin() | asinh() |
atan() | atan2() | atanh() | cbrt() | ceil() |
copysign() | cos() | cosh() | erf() | erfc() |
exp() | expm1() | exp2() | fabs() | fdim() |
floor() | fma() | fmax() | fmin() | fmod() |
frexp() | hypot() | ilogb() | ldexp() | lgamma() |
llrint() | llround() | log() | log1p() | log2() |
log10() | logb() | lrint() | lround() | modf() |
nearbyint() | nextafter() | nexttoward() | pow() | quantexp() |
remainder() | rint() | round() | scalbn() | scalbln() |
sin() | sinh() | sqrt() | tan() | tanh() |
tgamma() | trunc() |
acos() | acosh() | asin() | asinh() | atan() |
atanh() | atan2() | cbrt() | ceil() | copysign() |
cos() | cosh() | erf() | erfc() | exp() |
exp2() | expm1() | fabs() | fdim() | floor() |
fma() | fmax() | fmin() | fmod() | frexp() |
hypot() | ilogb() | ldexp() | lgamma() | llrint() |
llround() | log() | log10() | log1p() | log2() |
logb() | lrint() | lround() | nearbyint() | nextafter() |
nexttoward() | pow() | remainder() | remquo() | rint() |
round() | scalbln() | scalbn() | sin() | sinh() |
sqrt() | tan() | tanh() | tgamma() | trunc() |
Object-like macros: Additional object-like macros provided by the math.h header are described.
Function-like macros or C++ function templates: Additional function-like macros or C++ function templates provided by the <math.h> header are listed.
fpclassify() | isfinite() | ininf() | isgreater() | isgreaterequal() |
isless() | islessequal() | islessgreater() | isnan() | isnormal() |
isunordered() | signbit() |
The header file includes declarations for the built-in functions abs() and fabs(). For information about built-in functions, see Built-in functions.
The math.h header file declares the macro HUGE_VAL, which expands to a positive double constant expression, not necessarily representable as a float. Similarly, the macros HUGE_VALF and HUGE_VALL are respectively float and long double analogs of HUGE_VAL.
For all mathematical functions, a domain error occurs when an input argument is outside the range of values allowed for that function. If a domain error occurs, errno is set to the value of EDOM.
A range error occurs if the result of the function cannot be represented in a float, double, long double, _Decimal32, _Decimal64, or _Decimal128 value. If the magnitude of the result is too large (overflow), the function returns the positive or negative value of the macro HUGE_VAL, HUGE_VALF, HUGE_VALL, HUGE_VAL_D32, HUGE_VAL_D64, or HUGE_VAL_D128, as applicable, and sets errno to ERANGE. If the result is too small (underflow), the function returns 0.
A pole error occurs if the function has an exact infinite result as the finite input arguments are approached in the limit (for example, log(0.0)). If a pole error occurs, the function sets errno to ERANGE.
float_t and double_t are floating-point types whose type depends on the value of FLT_EVAL_METHOD. FLT_EVAL_METHOD is 1 which implies both float_t and double_t are double.