The absolute value of the number. If floating-point or integral, the return type will be the same as the input.
Limitations: Does not work correctly for signed intergal types and value Num.min.
ditto
import std.math.traits : isIdentical, isNaN; assert(isIdentical(abs(-0.0L), 0.0L)); assert(isNaN(abs(real.nan))); assert(abs(-real.infinity) == real.infinity); assert(abs(-56) == 56); assert(abs(2321312L) == 2321312L);
Calculates the absolute value of a number.