setY

constexpr void setY(const double y) noexcept

Sets the imaginary component y.

Parameters

const double y

A real number.

Sets the imaginary component of the complex object.

Example

Complex z;
z.setY(1);
std::cout << z << "\n";

Output:

0 + 1j