List of utility methods to do Abs
void | abs(double[] in) abs int height = in.length; for (int yy = 0; yy < height; yy++) { in[yy] = Math.abs(in[yy]); |
double[] | abs(double[] v) Takes the absolute value of each component of an array. double[] ans = new double[v.length]; for (int i = 0; i < v.length; i++) { ans[i] = Math.abs(v[i]); return (ans); |
double[][] | abs(double[][] A) absolute value double[][] C = new double[A.length][A[0].length]; for (int i = 0; i < A.length; i++) { for (int j = 0; j < A[i].length; j++) { C[i][j] = Math.abs(A[i][j]); return C; |
byte | abs(final byte x) Get absolute value with special case to ensure value doesn't cause XORed String be the same as the input. return (byte) Math.abs(x <= 0 ? x + 1 : x); |
double | abs(final double d) Returns the absolute value of d (without branching). return Double.longBitsToDouble(Long.MAX_VALUE & Double.doubleToRawLongBits(d));
|
double | abs(final double value) Return absolute value. return (value < 0 ? -value : value);
|
double | abs(final double x) abs return x < 0 ? -x : x;
|
int | abs(final int pNumber) A replacement for Math.abs , that never returns negative values. if (pNumber == Integer.MIN_VALUE) { throw new ArithmeticException("int overflow: 2147483648"); return (pNumber < 0) ? -pNumber : pNumber; |
float | abs(float f) abs if (f >= 0) return f; else return -f; |
float | abs(float value) abs return value >= 0.0F ? value : -value;
|