[complex.member.ops]

# 29 Numerics library [[numerics]](./#numerics)

## 29.4 Complex numbers [[complex.numbers]](complex.numbers#complex.member.ops)

### 29.4.5 Member operators [complex.member.ops]

[ð](#lib:operator+=,complex)

`constexpr complex& operator+=(const T& rhs);
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L441)

*Effects*: Adds the scalar value rhs to the real part of the complex value*this and stores the result in the real part of*this,
leaving the imaginary part unchanged[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L449)

*Returns*: *this[.](#2.sentence-1)

[ð](#lib:operator-=,complex)

`constexpr complex& operator-=(const T& rhs);
`

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L460)

*Effects*: Subtracts the scalar value rhs from the real part of the complex value*this and stores the result in the real part of*this,
leaving the imaginary part unchanged[.](#3.sentence-1)

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L468)

*Returns*: *this[.](#4.sentence-1)

[ð](#lib:operator*=,complex)

`constexpr complex& operator*=(const T& rhs);
`

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L479)

*Effects*: Multiplies the scalar value rhs by the complex value*this and stores the result in*this[.](#5.sentence-1)

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L486)

*Returns*: *this[.](#6.sentence-1)

[ð](#lib:operator/=,complex)

`constexpr complex& operator/=(const T& rhs);
`

[7](#7)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L497)

*Effects*: Divides the scalar value rhs into the complex value*this and stores the result in*this[.](#7.sentence-1)

[8](#8)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L504)

*Returns*: *this[.](#8.sentence-1)

[ð](#lib:operator=,complex)

`template<class X> constexpr complex& operator=(const complex<X>& rhs);
`

[9](#9)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L515)

*Effects*: Assigns the value rhs.real() to the real part and
the value rhs.imag() to the imaginary part
of the complex value *this[.](#9.sentence-1)

[10](#10)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L521)

*Returns*: *this[.](#10.sentence-1)

[ð](#lib:operator+=,complex_)

`template<class X> constexpr complex& operator+=(const complex<X>& rhs);
`

[11](#11)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L532)

*Effects*: Adds the complex value rhs to the complex value*this and stores the sum in*this[.](#11.sentence-1)

[12](#12)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L539)

*Returns*: *this[.](#12.sentence-1)

[ð](#lib:operator-=,complex_)

`template<class X> constexpr complex& operator-=(const complex<X>& rhs);
`

[13](#13)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L550)

*Effects*: Subtracts the complex value rhs from the complex value*this and stores the difference in*this[.](#13.sentence-1)

[14](#14)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L557)

*Returns*: *this[.](#14.sentence-1)

[ð](#lib:operator*=,complex_)

`template<class X> constexpr complex& operator*=(const complex<X>& rhs);
`

[15](#15)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L568)

*Effects*: Multiplies the complex value rhs by the complex value*this and stores the product in*this[.](#15.sentence-1)

[16](#16)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L575)

*Returns*: *this[.](#16.sentence-1)

[ð](#lib:operator/=,complex_)

`template<class X> constexpr complex& operator/=(const complex<X>& rhs);
`

[17](#17)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L586)

*Effects*: Divides the complex value rhs into the complex value*this and stores the quotient in*this[.](#17.sentence-1)

[18](#18)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L593)

*Returns*: *this[.](#18.sentence-1)
