# shz::complex

Source: https://sh4zam.com/api/cpp/complex/

C++ wrapper around a floating-point complex number, real/imaginary pair.

- **Header:** `#include <sh4zam/shz_complex.hpp>` ([source](https://github.com/gyrovorbis/sh4zam/blob/ba1e30c88d49df0311870b229e1dd860ef26c477/include/sh4zam/shz_complex.hpp#L30))
- **C type:** [`shz_complex_t`](https://sh4zam.com/api/complex/shz_complex_t/) (layout-compatible; the C API accepts it directly)
- **Bases:** `shz_complex_t`

## Members

### complex

```cpp
complex() noexcept=default
complex(const complex &rhs) noexcept=default
complex(float re, float im=0.0f) noexcept
complex(const shz_complex_t &cplx) noexcept
complex(const volatile shz_complex_t &cplx) noexcept
```

Default constructor.

### operator+=

```cpp
complex & operator+=(const complex &rhs) noexcept
```

Adds and accumulates `rhs` onto the given complex number.

Calls: [`shz_caddf()`](https://sh4zam.com/api/complex/shz_caddf/)

### operator-=

```cpp
complex & operator-=(const complex &rhs) noexcept
```

Subtracts `rhs` from the given complex number, assigning it to the result.

Calls: [`shz_csubf()`](https://sh4zam.com/api/complex/shz_csubf/)

### operator*=

```cpp
complex & operator*=(const complex &rhs) noexcept
complex & operator*=(float scale) noexcept
```

Multiplies and accumulates `rhs` by the given complex number.

Calls: [`shz_cmulf()`](https://sh4zam.com/api/complex/shz_cmulf/), [`shz_cscalef()`](https://sh4zam.com/api/complex/shz_cscalef/)

### operator/=

```cpp
complex & operator/=(const complex &rhs) noexcept
```

Divides the given complex number by `rhs`, assigning it to the result.

Calls: [`shz_cdivf()`](https://sh4zam.com/api/complex/shz_cdivf/)

### imag

```cpp
float shz_complex_t::imag
```

The imaginary portion of the complex number.

Inherited from `shz::vecN`.

### real

```cpp
float shz_complex_t::real
```

The real portion of the complex number.

Inherited from `shz::vecN`.
