src/org/kocakosm/pitaya/math/Numbers.java
public static int safeAbs(int a)
	{
		if (a == Integer.MIN_VALUE) {
			throw new ArithmeticException(
				"Int overflow: abs(" + a + ")");
		}
		return Math.abs(a);
	}
public static int safeAbs(int a)
	{
		if (a == Integer.MIN_VALUE) {
			throw new ArithmeticException(
				"Int overflow: abs(" + a + ")");
		}
		return Math.abs(a);
	}
Returns the absolute value of the given value, provided the result
fits into an {@code int}.

@param a the value.

@return the absolute value of {@code a}.

@throws ArithmeticException if the absolute value of {@code a} can't
be represented by an {@code int}.