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> | ||
template<class T,class CharT,class Traits> std::basic_ostream<CharT, Traits>& | (1) | |
template<class T,class CharT,class Traits> std::basic_istream<CharT, Traits>& | (2) | |
where the input forreal andimaginary must be convertible toT.
If an error occurs callsis.setstate(ios_base::failbit).Contents |
May throwstd::ios_base::failure on stream errors.
os | - | a character output stream |
is | - | a character input stream |
x | - | the complex number to be inserted or extracted |
template<class T,class CharT,class Traits>basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& o,const complex<T>& x){ basic_ostringstream<CharT, Traits> s; s.flags(o.flags()); s.imbue(o.getloc()); s.precision(o.precision()); s<<'('<< x.real()<<','<< x.imag()<<')';return o<< s.str();} |
#include <complex>#include <iostream> int main(){std::cout<<std::complex<double>{3.14,2.71}<<'\n';}
Possible output:
(3.14,2.71)