Get the absolute value of num. Because the return type is always unsigned, overflow is not possible.
import checkedint.sticky : smartOp; // smartOp.abs() never throws assert(smartOp.abs(int.min) == std.math.pow(2.0, 31)); assert(smartOp.abs(-25) == 25u); assert(smartOp.abs(745u) == 745u);
See Implementation
Get the absolute value of num. Because the return type is always unsigned, overflow is not possible.