log2

constexpr double log2(const Complex &z) noexcept

Returns the complex binary logarithm function [1] of a complex number \(z\).

Parameters

const Complex &z

A complex number.

Returns

type Complex

A complex number.

The binary logarithm of a complex number is defined as:

\[\DeclareMathOperator\arg{arg} \log_{2}(z) = \frac{\log(z)}{\log(2)}\]

Example

Complex z = 3 + 4_j;
std::cout << log2(z) << "\n";

Output:

0.69897 + 0.402719j

References