Common mathematical functions | |||||||||||||||||||||||||||||||
Mathematical special functions(C++17) | |||||||||||||||||||||||||||||||
Mathematical constants(C++20) | |||||||||||||||||||||||||||||||
Basic linear algebra algorithms(C++26) | |||||||||||||||||||||||||||||||
Data-parallel types (SIMD)(C++26) | |||||||||||||||||||||||||||||||
Floating-point environment(C++11) | |||||||||||||||||||||||||||||||
Complex numbers | |||||||||||||||||||||||||||||||
Numeric array (valarray ) | |||||||||||||||||||||||||||||||
Pseudo-random number generation | |||||||||||||||||||||||||||||||
Bit manipulation(C++20) | |||||||||||||||||||||||||||||||
Saturation arithmetic(C++26) | |||||||||||||||||||||||||||||||
Factor operations | |||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||
Interpolations | |||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||
Generic numeric operations | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
C-style checked integer arithmetic | |||||||||||||||||||||||||||||||
|
The C++ numerics library includes common mathematical functions and types, as well as optimized numeric arrays and support for random number generation.
Contents |
The header<cmath> providesstandard C library mathematical functions such asstd::fabs,std::sqrt, andstd::sin.
The header<cmath> also provides several mathematical special functions such asstd::beta,std::hermite, andstd::cyl_bessel_i.
The header<numbers> provides several mathematical constants, such asstd::numbers::pi orstd::numbers::sqrt2
The header<linalg> provides basic linear algebra algorithms which are based on BLAS.
The header<simd> provides portable types for explicitly stating data-parallelism and structuring data for more efficient SIMD access.
Defined in header <complex> | |
a complex number type (class template) |
Defined in header <valarray> | |
numeric arrays, array masks and array slices (class template) |
The header<numeric> provides numeric algorithms below:
Defined in header <numeric> | |
(C++17) | computes the greatest common divisor of two integers (function template)[edit] |
(C++17) | computes the least common multiple of two integers (function template)[edit] |
Defined in header <numeric> | |
(C++20) | midpoint between two numbers or pointers (function template)[edit] |
Defined in header <cmath> | |
(C++20) | linear interpolation function (function)[edit] |
Defined in header <numeric> | |
(C++26) | saturating addition operation on two integers (function template)[edit] |
(C++26) | saturating subtraction operation on two integers (function template)[edit] |
(C++26) | saturating multiplication operation on two integers (function template)[edit] |
(C++26) | saturating division operation on two integers (function template)[edit] |
(C++26) | returns an integer value clamped to the range of another integer type (function template)[edit] |
Defined in header <numeric> | |
(C++11) | fills a range with successive increments of the starting value (function template)[edit] |
(C++23) | fills a range with successive increments of the starting value (algorithm function object)[edit] |
sums up or folds a range of elements (function template)[edit] | |
(C++17) | similar tostd::accumulate, except out of order (function template)[edit] |
(C++17) | applies an invocable, then reduces out of order (function template)[edit] |
computes the inner product of two ranges of elements (function template)[edit] | |
computes the differences between adjacent elements in a range (function template)[edit] | |
computes the partial sum of a range of elements (function template)[edit] | |
(C++17) | similar tostd::partial_sum, includes theith input element in theith sum (function template)[edit] |
(C++17) | similar tostd::partial_sum, excludes theith input element from theith sum (function template)[edit] |
(C++17) | applies an invocable, then calculates inclusive scan (function template)[edit] |
(C++17) | applies an invocable, then calculates exclusive scan (function template)[edit] |
The header<random> definespseudo-random number generators and numerical distributions. The header<cstdlib> also includes C-style random number generation viastd::srand andstd::rand.
The header<cfenv> definesflags and functions related to exceptional floating-point state, such as overflow and division by zero.
The header<bit> provides several function templates to access, manipulate, and process individual bits and bit sequences. The byte ordering (endianness) of scalar types can be inspected viastd::endian facility.
The C compatibility header<stdckdint.h> provides several function templates for checked integer arithmetic.
Defined in header <stdckdint.h> | |
(C++26) | checked addition operation on two integers (function template)[edit] |
(C++26) | checked subtraction operation on two integers (function template)[edit] |
(C++26) | checked multiplication operation on two integers (function template)[edit] |
C documentation forNumerics |