math.h
The math.h header file contains function declarations for all the floating-point math functions.
No feature test macro required.
| absf() | absl() | acos() | acosf() | acosl() | asin() |
| asinf() | asinl() | atan() | atanf() | atanl() | atan2() |
| atan2f() | atan2l() | ceil() | ceilf() | ceill() | cos() |
| cosf() | cosl() | cosh() | coshf() | coshl() | exp() |
| expf() | expl() | fabsf() | fabsl() | floor() | floorf() |
| floorl() | fmod() | fmodf() | fmodl() | frexp() | frexpf() |
| frexpl() | ldexp() | ldexpf() | ldexpl() | log() | logf() |
| logl() | log10() | log10f() | log10l() | modf() | modff() |
| modfl() | pow() | powf() | powl() | sin() | sinf() |
| sinl() | sinh() | sinhf() | sinhl() | sqrt() | sqrtf() |
| sqrtl() | tan() | tanf() | tanl() | tanh() | tanhf() |
| tanhl() |
Special Behavior for C++
- float sqrt(float)
- double sqrt(double)
- long double sqrt(long double)
_XOPEN_SOURCE
| erf() | erfc() | gamma() | hypot() | isnan() |
| jn() | j0() | j1() | lgamma() | yn() |
| y0() | y1() |
_XOPEN_SOURCE_EXTENDED 1
| acosh() | asinh() | atanh() | cbrt() | expm1() |
| ilogb() | logb() | log1p() | nextafter() | remainder() |
| rint() | scalb() |
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 expression.
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 double value. If the magnitude of the result
is too large (overflow), the function returns the positive or negative
value of the macro HUGE_VAL, and sets errno to ERANGE. If the result
is too small (underflow), the function returns a value of 0.