operators
-
constexpr Complex operator+(const Complex &z1, const Complex &z2) noexcept
Arithmetic addition operator between two complex numbers.
-
constexpr Complex operator-(const Complex &z1, const Complex &z2) noexcept
Arithmetic subtraction operator between two complex numbers.
-
constexpr Complex operator*(const Complex &z1, const Complex &z2) noexcept
Arithmetic multiplication operator between two complex numbers.
-
constexpr Complex operator/(const Complex &z1, const Complex &z2) noexcept
Arithmetic division operator between two complex numbers.
-
constexpr Complex operator+(const Complex &z, const double alpha) noexcept
Arithmetic addition operator between a complex number and a real number.
-
constexpr Complex operator-(const Complex &z, const double alpha) noexcept
Arithmetic subtraction operator between a complex number and a real number.
-
constexpr Complex operator*(const Complex &z, const double alpha) noexcept
Arithmetic multiplication operator between a complex number and a real number.
-
constexpr Complex operator/(const Complex &z, const double alpha) noexcept
Arithmetic division operator between a complex number and a real number.
-
constexpr Complex operator+(const double alpha, const Complex &z) noexcept
Arithmetic addition operator between a complex number and a real number.
-
constexpr Complex operator-(const double alpha, const Complex &z) noexcept
Arithmetic subtraction operator between a complex number and a real number.
-
constexpr Complex operator*(const double alpha, const Complex &z) noexcept
Arithmetic multiplication operator between a complex number and a real number.
-
constexpr Complex operator/(const double alpha, const Complex &z) noexcept
Arithmetic division operator between a complex number and a real number.
-
constexpr bool operator==(const Complex &z1, const Complex &z2) noexcept
Equality operator between two complex numbers.
-
constexpr bool operator==(const Complex &z, const double alpha) noexcept
Equality operator between a complex number and a real number.
-
constexpr bool operator==(const double alpha, const Complex &z) noexcept
Equality operator between a complex number and a real number.
-
constexpr bool operator!=(const Complex &z1, const Complex &z2) noexcept
Inequality operator between two complex numbers.
-
constexpr bool operator!=(const Complex &z, const double alpha) noexcept
Inequality operator between a complex number and a real number.
-
constexpr bool operator!=(const double alpha, const Complex &z) noexcept
Inequality operator between a complex number and a real number.
-
constexpr std::ostream &operator<<(std::ostream &ostream, const Complex &z) noexcept
Serializes a complex number.
-
constexpr std::istream &operator>>(std::istream &istream, Complex &z) noexcept
Deserializes a complex number.
Parameters
- const Complex &z
A complex number.
- const double alpha
A real number.
- const unsigned long long y
A real number.
- const long double y
A real number.
Returns
- type Complex
A complex number.
Includes various key operators for complex numbers.
Example
Complex z = 3 + 4_j;
std::cout << z + 5 << "\n";
Output:
8 + 4j