On this page
std::complex<T>::operator+=,-=,*=,/=
Primary template complex<T> |
||
(1) | ||
|
(until C++20) | |
|
(since C++20) | |
(2) | ||
|
(until C++20) | |
|
(since C++20) | |
(3) | ||
|
(until C++20) | |
|
(since C++20) | |
(4) | ||
|
(until C++20) | |
|
(since C++20) | |
Specialization complex<float> |
||
(1) | ||
|
(until C++20) | |
|
(since C++20) | |
(2) | ||
|
(until C++20) | |
|
(since C++20) | |
(3) | ||
|
(until C++20) | |
|
(since C++20) | |
(4) | ||
|
(until C++20) | |
|
(since C++20) | |
Specialization complex<double> |
||
(1) | ||
|
(until C++20) | |
|
(since C++20) | |
(2) | ||
|
(until C++20) | |
|
(since C++20) | |
(3) | ||
|
(until C++20) | |
|
(since C++20) | |
(4) | ||
|
(until C++20) | |
|
(since C++20) | |
Specialization complex<long double> |
||
(1) | ||
|
(until C++20) | |
|
(since C++20) | |
(2) | ||
|
(until C++20) | |
|
(since C++20) | |
(3) | ||
|
(until C++20) | |
|
(since C++20) | |
(4) | ||
|
(until C++20) | |
|
(since C++20) | |
All specializations | ||
(5) | ||
|
(until C++20) | |
|
(since C++20) | |
(6) | ||
|
(until C++20) | |
|
(since C++20) | |
(7) | ||
|
(until C++20) | |
|
(since C++20) | |
(8) | ||
|
(until C++20) | |
|
(since C++20) |
Implements the compound assignment operators for complex arithmetic and for mixed complex/scalar arithmetic. Scalar arguments are treated as complex numbers with the real part equal to the argument and the imaginary part set to zero.
1,5) Adds
other
to *this
.
2,6) Subtracts
other
from *this
.
3,7) Multiplies
*this
by other
.
4,8) Divides
*this
by other
.
Parameters
other | - | a complex or scalar value of matching type (float , double , long double ) |
Return value
*this
See also
applies unary operators to complex numbers (function template) |
|
performs complex number arithmetic on two complex values or a complex and a scalar (function template) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/numeric/complex/operator_arith