List of utility methods to do Abs
double | absCap(double value, double bounds) Caps a value between -bounds to +bounds return Math.min(Math.max(value, -bounds), bounds);
|
double | absClamp(double value, double bounds) Clamps a value isBetween -bounds to +bounds return min(max(value, -bounds), bounds);
|
double | absDegrees(double degrees) abs Degrees if (degrees < 0) { for (int i = (int) Math.round(degrees / -360); i >= 0; i--) { degrees += 360; ; return degrees % 360; |
double | absDelta(double a, double b) abs Delta if (a == b) { return 0.0; if (Double.isNaN(a)) { return Double.isNaN(b) ? 0.0 : Double.POSITIVE_INFINITY; } else if (Double.isNaN(b)) { return Double.POSITIVE_INFINITY; return Math.abs(a - b); |
float | absDelta(float f1, float f2) Compute the absolute value of the difference between two floating-point numbers having single precision. double delta = f1 - f2; return (float) ((delta < 0) ? delta * -1.0 : delta); |
long | absDiff(long x, long y) abs Diff final long d = x - y; if (d < 0) return d * -1; return d; |
int | absHash(Object obj) abs Hash return Math.abs(hash(obj));
|
int | absNeg(final int a) abs Neg return (a >> 31) - (a ^ a >> 31);
|
long | absNeg(long a) abs Neg return (a >> 63) - (a ^ (a >> 63));
|
float | absNegativeZeros(float f) If f is -0.0f, return 0.0f; otherwise, return f . return f == 0.0f ? 0.0f : f;
|