List of utility methods to do Number Copy Sign
double | copySign(Double magnitude, Double sign) Copy sign. return Math.copySign(magnitude, sign);
|
double | copySign(double magnitude, double sign) copy Sign if (sign < 0) { return (magnitude < 0) ? magnitude : -magnitude; } else { return (magnitude > 0) ? magnitude : -magnitude; |
double | copySign(double x, double y) Returns one value with the sign of another (like copysign). return y >= 0.0 ? Math.abs(x) : -Math.abs(x);
|
double | copySign(final double magnitude, final double sign) Copies the sign of sign into magnitude. final long m = Double.doubleToLongBits(magnitude); final long s = Double.doubleToLongBits(sign); if (0 <= (m ^ s)) return -magnitude; return magnitude; |
double | copysign(final double x, final double y) copysign return (y < 0.0D && x > 0.0D) ? -x : ((y > 0.0D && x < 0.0D) ? -x : x);
|
double | copySign(final double x, final double y) copy Sign return Double.longBitsToDouble((Double.doubleToLongBits(x) & 0x7fffffffffffffffL)
| (Double.doubleToLongBits(y) & 0x8000000000000000L));
|