Namespaces
Variants

Common mathematical functions

From cppreference.com
 
 
 
Common mathematical functions
 

Functions

Defined in header <cstdlib>
computes absolute value of an integral value (|x|)
(function) [edit]
computes quotient and remainder of integer division
(function) [edit]
Defined in header <cinttypes>
computes absolute value of an integral value (|x|)
(function) [edit]
computes quotient and remainder of integer division
(function) [edit]
Defined in header <cmath>
Basic operations
absolute value of a floating point value (|x|)
(function) [edit]
(C++11)(C++11)
remainder of the floating point division operation
(function) [edit]
(C++11)(C++11)(C++11)
signed remainder of the division operation
(function) [edit]
(C++11)(C++11)(C++11)
signed remainder as well as the three last bits of the division operation
(function) [edit]
(C++11)(C++11)(C++11)
fused multiply-add operation
(function) [edit]
(C++11)(C++11)(C++11)
larger of two floating-point values
(function) [edit]
(C++11)(C++11)(C++11)
smaller of two floating point values
(function) [edit]
(C++11)(C++11)(C++11)
positive difference of two floating point values (max(0, x-y))
(function) [edit]
(C++11)(C++11)(C++11)
not-a-number (NaN)
(function) [edit]
Exponential functions
(C++11)(C++11)
returns e raised to the given power (ex)
(function) [edit]
(C++11)(C++11)(C++11)
returns 2 raised to the given power (2x)
(function) [edit]
(C++11)(C++11)(C++11)
returns e raised to the given power, minus 1 (ex-1)
(function) [edit]
(C++11)(C++11)
computes natural (base e) logarithm (ln(x))
(function) [edit]
(C++11)(C++11)
computes common (base 10) logarithm (log10(x))
(function) [edit]
(C++11)(C++11)(C++11)
base 2 logarithm of the given number (log2(x))
(function) [edit]
(C++11)(C++11)(C++11)
natural logarithm (to base e) of 1 plus the given number (ln(1+x))
(function) [edit]
Power functions
(C++11)(C++11)
raises a number to the given power (xy)
(function) [edit]
(C++11)(C++11)
computes square root (x)
(function) [edit]
(C++11)(C++11)(C++11)
computes cube root (3x)
(function) [edit]
(C++11)(C++11)(C++11)
computes hypotenuse x2
+y2
and x2
+y2
+z2
(since C++17)

(function) [edit]
Trigonometric functions
(C++11)(C++11)
computes sine (sin(x))
(function) [edit]
(C++11)(C++11)
computes cosine (cos(x))
(function) [edit]
(C++11)(C++11)
computes tangent (tan(x))
(function) [edit]
(C++11)(C++11)
computes arc sine (arcsin(x))
(function) [edit]
(C++11)(C++11)
computes arc cosine (arccos(x))
(function) [edit]