operator<<,>>(std::complex)

< cpp‎ | numeric‎ | complex

C++
 Language Standard library headers Concepts Utilities library Strings library Containers library Algorithms library Iterators library Numerics library Input/output library Localizations library Regular expressions library (C++11) Atomic operations library (C++11) Thread support library (C++11) Filesystem library (C++17) Technical Specifications

Numerics library
 Common mathematical functions Special mathematical functions Floating-point environment (C++11) Complex numbers Numeric arrays Pseudo-random number generation Compile-time rational arithmetic (C++11) Numeric algorithms gcd(C++17) lcm(C++17) Generic numeric operations iota(C++11) accumulate inner_product adjacent_difference partial_sum

std::complex
Member functions
Non-member functions
 operator+operator- operator+operator-operator*operator/ operator==operator!= operator<>
 real imag abs arg norm conj proj(C++11) polar operator""ioperator""ifoperator""il(C++14)(C++14)(C++14)
Exponential functions
Power functions
Trigonometric functions
 asin(C++11) acos(C++11) atan(C++11)
Hyperbolic functions
 asinh(C++11) acosh(C++11) atanh(C++11)

 Defined in header template std::basic_ostream&     operator<<(std::basic_ostream& os,                const std::complex& x); (1) template std::basic_istream&     operator>>(std::basic_istream& is,                std::complex& x); (2)
1) Writes to os the complex number in the form (real,imaginary).
2) Reads a complex number from is. The supported formats are
• real
• (real)
• (real,imaginary)

Where the input for real and imaginary must be convertible to T.

If an error occurs calls is.setstate(ios_base::failbit)

Exceptions

May throw std::ios_base::failure on stream errors.

Parameters

 os - a character output stream is - a character input stream x - the complex number to be inserted or extracted

1) os
2) is