private int signum(int number) { int result = 0; if (number != 0) { result = number / Math.abs(number); } return result; }