im

constexpr double im() const noexcept

Gets the imaginary component y.

Returns

double

A real number.

Gets the imaginary component of the complex object.

Example

Complex z(1, 4);
std::cout << z.im() << "\n";

Output:

4