eric/div_sat "cpp/numeric/div sat") (C++26)  
  
  
  
[ Generic numeric operations ](/w/cpp/numeric#Numeric_operations
"cpp/numeric")  
|  [ iota  ](/w/cpp/algorithm/iota "cpp/algorithm/iota") (C++11)  
---  
[ ranges::iota  ](/w/cpp/algorithm/ranges/iota "cpp/algorithm/ranges/iota")
(C++23)  
[ accumulate  ](/w/cpp/algorithm/accumulate "cpp/algorithm/accumulate")  
[ inner_product  ](/w/cpp/algorithm/inner_product "cpp/algorithm/inner
product")  
[ adjacent_difference  ](/w/cpp/algorithm/adjacent_difference
"cpp/algorithm/adjacent difference")  
[ partial_sum  ](/w/cpp/algorithm/partial_sum "cpp/algorithm/partial sum")  
  
|  [ reduce  ](/w/cpp/algorithm/reduce "cpp/algorithm/reduce") (C++17)  
---  
[ transform_reduce  ](/w/cpp/algorithm/transform_reduce
"cpp/algorithm/transform reduce") (C++17)  
[ inclusive_scan  ](/w/cpp/algorithm/inclusive_scan "cpp/algorithm/inclusive
scan") (C++17)  
[ exclusive_scan  ](/w/cpp/algorithm/exclusive_scan "cpp/algorithm/exclusive
scan") (C++17)  
[ transform_inclusive_scan  ](/w/cpp/algorithm/transform_inclusive_scan
"cpp/algorithm/transform inclusive scan") (C++17)  
[ transform_exclusive_scan  ](/w/cpp/algorithm/transform_exclusive_scan
"cpp/algorithm/transform exclusive scan") (C++17)  
  
[ Bit operations ](/w/cpp/numeric#Bit_manipulation_.28since_C.2B.2B20.29
"cpp/numeric")  
|  [ has_single_bit  ](/w/cpp/numeric/has_single_bit "cpp/numeric/has single
bit") (C++20)  
---  
[ bit_cast  ](/w/cpp/numeric/bit_cast "cpp/numeric/bit cast") (C++20)  
[ bit_ceil  ](/w/cpp/numeric/bit_ceil "cpp/numeric/bit ceil") (C++20)  
[ bit_floor  ](/w/cpp/numeric/bit_floor "cpp/numeric/bit floor") (C++20)  
[ bit_width  ](/w/cpp/numeric/bit_width "cpp/numeric/bit width") (C++20)  
[ rotl  ](/w/cpp/numeric/rotl "cpp/numeric/rotl") (C++20)  
[ rotr  ](/w/cpp/numeric/rotr "cpp/numeric/rotr") (C++20)  
  
|  [ popcount  ](/w/cpp/numeric/popcount "cpp/numeric/popcount") (C++20)  
---  
[ countl_zero  ](/w/cpp/numeric/countl_zero "cpp/numeric/countl zero") (C++20)  
[ countl_one  ](/w/cpp/numeric/countl_one "cpp/numeric/countl one") (C++20)  
[ countr_zero  ](/w/cpp/numeric/countr_zero "cpp/numeric/countr zero") (C++20)  
[ countr_one  ](/w/cpp/numeric/countr_one "cpp/numeric/countr one") (C++20)  
[ byteswap  ](/w/cpp/numeric/byteswap "cpp/numeric/byteswap") (C++23)  
[ endian  ](/w/cpp/types/endian "cpp/types/endian") (C++20)  
  
[ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/numeric/navbar_content&action=edit)

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

##  Contents

  * 1  Mathematical functions and types 
    * 1.1  Common mathematical functions 
    * 1.2  Mathematical special functions  (since C++17) 
    * 1.3  Mathematical constants  (since C++20) 
    * 1.4  Basic linear algebra algorithms  (since C++26) 
    * 1.5  Complex number arithmetic 
    * 1.6  Numeric arrays 
  * 2  Numeric algorithms 
    * 2.1  Factor operations 
    * 2.2  Interpolation operations 
    * 2.3  Saturation arithmetic  (since C++26) 
    * 2.4  Numeric operations 
  * 3  Miscellanous 
    * 3.1  Pseudo-random number generation 
    * 3.2  Floating-point environment  (since C++11) 
    * 3.3  Bit manipulation  (since C++20) 
    * 3.4  See also 

  
---  
  
##  [ [ edit ](/mwiki/index.php?title=cpp/numeric&action=edit&section=1 "Edit
section: Mathematical functions and types") ]  Mathematical functions and
types

###  [ [ edit ](/mwiki/index.php?title=cpp/numeric&action=edit&section=2 "Edit
section: Common mathematical functions") ]  [ Common mathematical functions
](/w/cpp/numeric/math "cpp/numeric/math")

The header [ ` <cmath> ` ](/w/cpp/header/cmath "cpp/header/cmath") provides [
standard C library mathematical functions ](/w/cpp/numeric/math
"cpp/numeric/math") such as  [ std::fabs ](/w/cpp/numeric/math/fabs
"cpp/numeric/math/fabs") ,  [ std::sqrt ](/w/cpp/numeric/math/sqrt
"cpp/nu