Namespaces
Variants
Views
Actions

std::complex::operator+=,-=,*=,/=

From cppreference.com
< cpp‎ | numeric‎ | complex
Revision as of 22:38, 9 February 2014 by D41D8CD98F (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
complex<T>& operator+=( const T& other );
(1)
complex<T>& operator+=( const complex<T>& other );
(2)
complex<T>& operator-=( const T& other );
(3)
complex<T>& operator-=( const complex<T>& other );
(4)
complex<T>& operator*=( const T& other );
(5)
complex<T>& operator*=( const complex<T>& other );
(6)
complex<T>& operator/=( const T& other );
(7)
complex<T>& operator/=( const complex<T>& other );
(8)

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-2) Adds other to *this.
3-4) Subtracts other from *this.
5-6) Multiplies *this by other.
7-8) Divides *this by other.

[edit] Parameters

other - a complex or scalar value of matching type (float, double, long double)

[edit] Return value

*this

[edit] See also

applies unary operators to complex numbers
(function template) [edit]
performs complex number arithmetics on two complex values or a complex and a scalar
(function template) [edit]