import std.math.traits : isIdentical; assert(isIdentical(fabs(0.0f), 0.0f)); assert(isIdentical(fabs(-0.0f), 0.0f)); assert(fabs(-10.0f) == 10.0f); assert(isIdentical(fabs(0.0), 0.0)); assert(isIdentical(fabs(-0.0), 0.0)); assert(fabs(-10.0) == 10.0); assert(isIdentical(fabs(0.0L), 0.0L)); assert(isIdentical(fabs(-0.0L), 0.0L)); assert(fabs(-10.0L) == 10.0L);
Returns |x|