List of utility methods to do Abs
float | abs(float value) abs return value >= 0.0F ? value : -value;
|
float[] | abs(float[] items) abs return abs(items, 0, items.length);
|
float[] | abs(float[] values) abs for (int i = 0; i < values.length; i++) values[i] = Math.abs(values[i]); return values; |
int | abs(int i) Betrag der gegebenen Zahl. return i < 0 ? -i : i;
|
int | abs(int n) Computes the absolute value of a number without branching The original code can be found in: http://graphics.stanford.edu/~seander/bithacks.html#IntegerAbs final int n31 = n >> 31; return (n + n31) ^ n31; |
int | abs(int number) return the absolute integer return (number < 0) ? -number : number;
|
double | abs(int pos, double[] array) Computes the absolute value of the complex number at position pos in the array return Math.sqrt(Math.pow(array[pos * 2], 2) + Math.pow(array[(2 * pos) + 1], 2));
|
int | abs(int val) abs if (val >= 0) return val; return val * -1; |
int | abs(int val) abs int sign = (val >> 31); return (val ^ sign) - sign; |
int | abs(int value) This method returns the absolute value of the provided value. if (value < 0) { return -value; return value; |