A real number.
The squared modulus of z. For genericity, if called on a real number, returns its square.
import std.math.operations : isClose; assert(sqAbs(complex(0.0)) == 0.0); assert(sqAbs(complex(1.0)) == 1.0); assert(sqAbs(complex(0.0, 1.0)) == 1.0); assert(isClose(sqAbs(complex(1.0L, -2.0L)), 5.0L)); assert(isClose(sqAbs(complex(-3.0L, 1.0L)), 10.0L)); assert(isClose(sqAbs(complex(1.0f,-1.0f)), 2.0f));