Table of Contents

C++ Numerics library

https://en.cppreference.com/w/cpp/numeric

The C++ numerics library includes common mathematical functions and types, as well as optimized numeric arrays and support for random number generation.

Mathematical functions and types

[[cpp/numeric/math|Common mathematical functions]]

The header

provides standard C library mathematical functions such as

,

, and

.

[[cpp/numeric/special_functions|Mathematical special functions]] {{mark since c++17}}

The header

also provides several mathematical special functions such as

,

, and

.

[[cpp/numeric/constants|Mathematical constants]] {{mark since c++20}}

The header

provides several mathematical constants, such as

or

Complex number arithmetic

Numeric arrays

Numeric algorithms

The header

provides numeric algorithms below:

Factor operations

Interpolation operations

Numeric operations

Miscellanous

[[cpp/numeric/random|Pseudo-random number generation]]

The header

defines pseudo-random number generators and numerical distributions. The header

also includes C-style random number generation via

and

.

[[cpp/numeric/ratio|Compile time rational arithmetic]] {{mark since c++11}}

The header

provides types and functions for manipulating and storing compile-time ratios.

[[cpp/numeric/fenv|Floating-point environment]] {{mark since c++11}}

The header

defines flags and functions related to exceptional floating-point state, such as overflow and division by zero.

Bit manipulation {{mark since c++20}}

The header

provides several function templates to access, manipulate, and process individual bits and bit sequences.

See also