log10

Calculate the base-10 logarithm of x.

@safe pure nothrow @nogc
log10
(
T
)

Parameters

x Complex!T

A complex number

Return Value

Type: Complex!T

The complex base 10 logarithm of x

Examples

import std.math : LN10, PI, isClose, sqrt;

auto a = complex(2.0, 1.0);
assert(log10(a) == log(a) / log(complex(10.0)));

auto b = log10(complex(0.0, 1.0)) * 2.0;
auto c = log10(complex(sqrt(2.0) / 2, sqrt(2.0) / 2)) * 4.0;
assert(isClose(b, c, 0.0, 1e-15));

assert(ceqrel(log10(complex(-100.0L, 0.0L)), complex(2.0L, PI / LN10)) >= real.mant_dig - 1);
assert(ceqrel(log10(complex(-100.0L, -0.0L)), complex(2.0L, -PI / LN10)) >= real.mant_dig - 1);

Meta

Suggestion Box / Bug Report