Java Utililty Methods Abs

List of utility methods to do Abs

Description

The list of methods to do Abs are organized into topic(s).

Method

doubleabs(double value)
Absolute Value alternative to MathHelper#abs(float par0) for Double values
if (value < 0) {
    return 0f;
} else {
    return value;
doubleabs(double x)
abs
if (x >= 0)
    return x;
else
    return -x;
doubleabs(double x)
abs
return Double.longBitsToDouble(MASK_NON_SIGN_LONG & Double.doubleToRawLongBits(x));
doubleabs(double x)
abs
return x <= 0 ? 0.0 - x : x;
doubleabs(double z)
Returns absolute value of double number.
return (z < 0) ? -z : z;
double[]abs(double... values)
abs
double[] values2 = new double[values.length];
for (int i = 0; i < values.length; i++) {
    values2[i] = Math.abs(values[i]);
return values2;
voidabs(double[] arr)
Computes the absolute value for each element in the array, in place.
for (int i = 0; i < arr.length; i++) {
    arr[i] = Math.abs(arr[i]);
voidabs(double[] array)
abs
for (int i = 0; i < array.length; i++)
    array[i] = Math.abs(array[i]);
double[]abs(double[] da)
abs
double[] out = da.clone();
for (int i = 0; i < out.length; i++) {
    out[i] = Math.abs(out[i]);
return out;
double[]abs(double[] in)
abs
if (in != null && in.length > 0) {
    double[] out = new double[in.length];
    for (int i = 0; i < in.length; i++) {
        out[i] = Math.abs(in[i]);
    return out;
} else {
    return null;
...