Common mathematical functions

From cppreference.com
 
 
 
Common mathematical functions
Functions
Basic operations
remainder (C99)
remquo (C99)
fma (C99)
fmax (C99)
fmin (C99)
fdim (C99)
nan
nanf
nanl
(C99)
(C99)
(C99)
Exponential functions
exp
exp2 (C99)
expm1 (C99)
log
log10
log1p (C99)
log2 (C99)
Power functions
sqrt
cbrt (C99)
hypot (C99)
pow
Trigonometric and hyperbolic functions
sinh
cosh
tanh
asinh (C99)
acosh (C99)
atanh (C99)
Error and gamma functions
erf (C99)
erfc (C99)
lgamma (C99)
tgamma (C99)
Nearest integer floating point operations
ceil
floor
round
lround
llround
(C99)
(C99)
(C99)
trunc (C99)
nearbyint (C99)
rint
lrint
llrint
(C99)
(C99)
(C99)
Floating point manipulation functions
ldexp
scalbn
scalbln
(C99)
(C99)
ilogb (C99)
logb (C99)
Classification
fpclassify (C99)
isfinite (C99)
isinf (C99)
isnan (C99)
isnormal (C99)
signbit (C99)
Macro constants
 

Contents

[edit] Functions

Defined in header <math.h>
Basic operations
computes absolute value of an integral value (|x|)
(function)
absolute value of a floating point value (|x|)
(function)
the quotient and remainder of integer division
(function)
remainder of the floating point division operation
(function)
(C99)
signed remainder of the division operation
(function)
(C99)
signed remainder as well as the three last bits of the division operation
(function)
(C99)
fused multiply-add operation
(function)
(C99)
larger of two floating point values
(function)
(C99)
smaller of two floating point values
(function)
(C99)
positive difference of two floating point values (max(0, x-y))
(function)
(C99)
(C99)
(C99)
not-a-number (NaN)
(function)
Exponential functions
returns e raised to the given power (ex)
(function)
(C99)
returns 2 raised to the given power (2x)
(function)
(C99)
returns e raised to the given power, minus one (ex-1)
(function)
computes natural (base e) logarithm (to base e) (ln(x))
(function)
computes common (base 10) logarithm (log10(x))
(function)
(C99)
natural logarithm (to base e) of 1 plus the given number
(function)
(C99)
base 2 logarithm of the given number
(function)
Power functions
computes square root (x)
(function)
(C99)
computes cubic root (3x)
(function)
(C99)
computes square root of the sum of the squares of two given numbers (x2
+y2
)
(function)
raises a number to the given power (xy)
(function)
Trigonometric functions
computes sine (sin(x))
(function)
computes cosine (cos(x))
(function)
computes tangent (tan(x))
(function)
computes arc sine (arcsin(x))
(function)
computes arc cosine (arccos(x))
(function)
computes arc tangent (arctan(x))
(function)
arc tangent, using signs to determine quadrants
(function)
Hyperbolic functions
computes hyperbolic sine (sh(x))
(function)
computes hyperbolic cosine (ch(x))
(function)
hyperbolic tangent
(function)
(C99)
hyperbolic arc sine
(function)
(C99)
hyperbolic arc cosine
(function)
(C99)
hyperbolic arc tangent
(function)
Error and gamma functions
(C99)
error function
(function)
(C99)
complementary error function
(function)
(C99)
natural logarithm of the gamma function
(function)
(C99)
gamma function
(function)
Nearest integer floating point operations
nearest integer not less than the given value
(function)
nearest integer not greater than the given value
(function)
(C99)
nearest integer not greater in magnitude than the given value
(function)
(C99)
(C99)
(C99)
nearest integer, rounding away from zero in halfway cases
(function)
(C99)
nearest integer using current rounding mode
(function)
(C99)
(C99)
(C99)
nearest integer using current rounding mode with
exception if the result differs
(function)
Floating point manipulation functions
decomposes a number into significand and a power of 2
(function)
multiplies a number by 2 raised to a power
(function)
decomposes a number into integer and fractional parts
(function)
(C99)
(C99)
multiplies a number by FLT_RADIX raised to a power
(function)
(C99)
extracts exponent of the number
(function)
(C99)
extracts exponent of the number
(function)
next representable floating point value towards the given value
(function)
(C99)
copies the sign of a floating point value
(function)
Classification
categorizes the given floating point value
(function)
(C99)
checks if the given number has finite value
(function)
(C99)
checks if the given number is infinite
(function)
(C99)
checks if the given number is NaN
(function)
(C99)
checks if the given number is normal
(function)
(C99)
checks if the given number is negative
(function)

[edit] Macro constants

Defined in header <math.h>
indicates value too big to be representable (infinity) by float, double and long double respectively
(macro constant)
Classification
indicates a floating-point category
(macro constant)