Open In App

<numeric> library in C++ STL

Improve
Improve
Like Article
Like
Save
Share
Report

Common mathematical functions

  • std::fabs: This function returns the absolute value.
  • std::sqrt: This function returns the square root
  • std::sin: This function returns the sine measured in radians.

Special mathematical functions

  • std::beta: This function evaluates the (complete) Beta integral with given parameters
  • std::hermite: This function Returns the value of the Hermite Polynomial of order n at point x
  • std::cyl_bessel_i: This function returns value of the regular modified cylindrical Bessel function.

Complex number arithmetic

  • complex: a complex number class, defined in header (class template)

Numeric arrays

  • valarray : numeric arrays, array masks and array slices (class template)

Factor operations(Defined in header )

  • gcd: constexpr function template returning the greatest common divisor of two integers. (function template)
  • lcm: constexpr function template returning the least common multiple of two integers (function template)

Numeric operations(Defined in header )

  • iota: fills a range with successive increments of the starting value (function template)
  • accumulate: sums up a range of elements (function template)
  • reduce: similar to std::accumulate, except out of order (function template)
  • transform_reduce: applies a functor, then reduces out of order (function template)
  • inner_product: computes the inner product of two ranges of elements .(function template)
  • adjacent_difference: computes the differences between adjacent elements in a range (function template)
  • partial_sum: computes the partial sum of a range of elements (function template)
  • inclusive_scan: similar to std::partial_sum, includes the ith input element in the ith sum (function template)
  • exclusive_scan: similar to std::partial_sum, excludes the ith input element from the ith sum (function template)
  • transform_inclusive_scan: applies a functor, then calculates inclusive scan (function template)
  • transform_exclusive_scan: applies a functor, then calculates exclusive scan (function template)

More Useful Links


Last Updated : 04 Apr, 2018
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads