List of utility methods to do Number Sign
int | signum(byte[] value) signum if (value.length > 0) { if (value[0] < 0) { return -1; for (int i = 0; i < value.length; i++) { if (value[i] != 0) { return 1; return 0; |
double | signum(Double d) Signum. return Math.signum(d);
|
int | signum(double value) Returns the signum of the long value, i.e. return (int) Math.signum(value); |
int | signum(double z) Returns sign of double number. return (z < 0) ? -1 : 1;
|
int | signum(final double x) Returns the signum function of the specified double value. if (x < 0) { return -1; if (x > 0) { return 1; return 0; |
int | signum(final int a) signum return a < 0 ? -1 : a == 0 ? 0 : 1;
|
int | signum(final int i) signum function. if (i < 0) { return -1; } else if (i > 0) { return 1; } else { return 0; |
int | signum(final int n) Returns the signum function of the argument; zero if the argument is zero, 1 if the argument is greater than zero, -1 if the argument is less than zero. if (n > 0) { return 1; } else if (n < 0) { return -1; } else { return 0; |
int | signum(final int value) signum if (value > 0) { return 1; } else if (value < 0) { return -1; } else { return 0; |
float | signum(float f) Returns -1.0, 0.0, or 1.0 as the given float is negative, zero, or positive, respectively. if (f == 0.0f) return 0.0f; return f < 0.0f ? -1.0f : 1.0f; |