src/org/kocakosm/pitaya/math/Numbers.java
public static long safeDivide(long a, long b)
	{
		if (a == Long.MIN_VALUE && b == -1L) {
			throw new ArithmeticException(
				"Long overflow: " + a + " / " + b);
		}
		return a / b;
	}
public static long safeDivide(long a, long b)
	{
		if (a == Long.MIN_VALUE && b == -1L) {
			throw new ArithmeticException(
				"Long overflow: " + a + " / " + b);
		}
		return a / b;
	}
public static long safeDivide ( long a , long b ) { if ( a == Long . MIN_VALUE && b == - 1L ) { throw new ArithmeticException ( "Long 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 a {@code long}.

@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 a {@code long}.
Returns the result of the integer division of the first number by the second provided the result fits into a { @code long } .