src/org/kocakosm/pitaya/math/Numbers.java
public static int safeDivide(int a, int b)
	{
		if (a == Integer.MIN_VALUE && b == -1L) {
			throw new ArithmeticException(
				"Int overflow: " + a + " / " + b);
		}
		return a / b;
	}
public static int safeDivide(int a, int b)
	{
		if (a == Integer.MIN_VALUE && b == -1L) {
			throw new ArithmeticException(
				"Int overflow: " + a + " / " + b);
		}
		return a / b;
	}
Returns the result of the integer division of the first number by the
second, provided the result fits into an {@code int}.

@param a the dividend.
@param b the divisor.

@return {@code a / b}.

@throws ArithmeticException if {@code b} is equal to {@code 0} or if
{@code a / b} can't be represented by an {@code int}.