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 | |||||||||||||||||||||||||||||||
|
Member functions | ||||||||||||||||||||||||||
Non-member functions | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
Exponential functions | ||||||||||||||||||||||||||
Power functions | ||||||||||||||||||||||||||
Trigonometric functions | ||||||||||||||||||||||||||
Hyperbolic functions | ||||||||||||||||||||||||||
Helper types | ||||||||||||||||||||||||||
(C++26) | ||||||||||||||||||||||||||
(C++26) |
Defined in header <complex> | ||
(1) | ||
template<class T> bool operator==(const complex<T>& lhs,const complex<T>& rhs); | (until C++14) | |
template<class T> constexprbool operator==(const complex<T>& lhs,const complex<T>& rhs); | (since C++14) | |
(2) | ||
template<class T> bool operator==(const complex<T>& lhs,const T& rhs); | (until C++14) | |
template<class T> constexprbool operator==(const complex<T>& lhs,const T& rhs); | (since C++14) | |
(3) | ||
template<class T> bool operator==(const T& lhs,const complex<T>& rhs); | (until C++14) | |
template<class T> constexprbool operator==(const T& lhs,const complex<T>& rhs); | (since C++14) (until C++20) | |
(4) | ||
template<class T> bool operator!=(const complex<T>& lhs,const complex<T>& rhs); | (until C++14) | |
template<class T> constexprbool operator!=(const complex<T>& lhs,const complex<T>& rhs); | (since C++14) (until C++20) | |
(5) | ||
template<class T> bool operator!=(const complex<T>& lhs,const T& rhs); | (until C++14) | |
template<class T> constexprbool operator!=(const complex<T>& lhs,const T& rhs); | (since C++14) (until C++20) | |
(6) | ||
template<class T> bool operator!=(const T& lhs,const complex<T>& rhs); | (until C++14) | |
template<class T> constexprbool operator!=(const T& lhs,const complex<T>& rhs); | (since C++14) (until C++20) | |
Compares two complex numbers. Scalar arguments are treated as complex numbers with the real part equal to the argument and the imaginary part set to zero.
The | (since C++20) |
lhs, rhs | - | the arguments to compare: either both complex numbers or one complex and one scalar of matching type (float,double,longdouble) |
#include <complex> int main(){using std::operator""i;// or: using namespace std::complex_literals; static_assert(1.0i== 1.0i); static_assert(2.0i!= 1.0i); constexprstd::complex z(1.0,0.0); static_assert(z==1.0); static_assert(1.0== z); static_assert(2.0!= z); static_assert(z!=2.0);}