The OpenD Programming Language

abs

@safe pure nothrow @nogc
T
abs
(
T
)

Return Value

Type: T

The absolute value (or modulus) of z.

Examples

static import core.math;
assert(abs(complex(1.0)) == 1.0);
assert(abs(complex(0.0, 1.0)) == 1.0);
assert(abs(complex(1.0L, -2.0L)) == core.math.sqrt(5.0L));

Meta