The OpenD Programming Language

cabs

@safe pure nothrow @nogc
T
cabs
(
T
)

Return Value

Type: T

The absolute value (or modulus) of z.

Examples

import mir.math.common: sqrt;
assert(cabs(complex(1.0)) == 1.0);
assert(cabs(complex(0.0, 1.0)) == 1.0);
assert(cabs(complex(1.0L, -2.0L)) == sqrt(5.0L));

Meta