absdiff

Returns the absolute difference between two numbers.

Num
absdiff
pure nothrow
(
Num
)
(
in Num a
,
in Num b
)
if (
isNumeric!Num
)

Examples

assert(absdiff(2UL, 3UL) == 1UL);
assert(absdiff(-42, 13) == 55);
assert(absdiff(2.5, 5) == 2.5);

Meta