src/org/kocakosm/pitaya/math/Numbers.java
public static long lcm(long a, long b)
	{
		try {
			if (a < 0L || b < 0L) {
				return lcm(safeAbs(a), safeAbs(b));
			}
			if (a == 0L) {
				return b;
			}
			if (b == 0L) {
				return a;
			}
			return safeMultiply(a / gcd(a, b), b);
		} catch (ArithmeticException e) {
			throw new ArithmeticException(
				"Long overflow: lcm(" + a + ", " + b + ")");
		}
	}
public static long lcm(long a, long b)
	{
		try {
			if (a < 0L || b < 0L) {
				return lcm(safeAbs(a), safeAbs(b));
			}
			if (a == 0L) {
				return b;
			}
			if (b == 0L) {
				return a;
			}
			return safeMultiply(a / gcd(a, b), b);
		} catch (ArithmeticException e) {
			throw new ArithmeticException(
				"Long overflow: lcm(" + a + ", " + b + ")");
		}
	}
public static long lcm ( long a , long b ) { try { if ( a < 0L || b < 0L ) { return lcm ( safeAbs ( a ) , safeAbs ( b ) ) ; } if ( a == 0L ) { return b ; } if ( b == 0L ) { return a ; } return safeMultiply ( a / gcd ( a , b ) , b ) ; } catch ( ArithmeticException e ) { throw new ArithmeticException ( "Long overflow: lcm(" + a + ", " + b + ")" ) ; } }
Returns the least common multiple of the absolute value of the given
two numbers. This method first computes the absolute values of the
given numbers, thus it doesn't accept {@code Long.MIN_VALUE}. Also,
note that if one of the given values is {@code 0}, this method will
return the absolute value of the second argument. This method uses
the formula {@code lcm(a,b) = (a / gcd(a,b)) * b}. Please refer to
<a href="http://en.wikipedia.org/wiki/Least_common_multiple">
Wikipedia</a> for further information.

@param a the first number.
@param b the second number.

@return the least common multiple of {@code a} and {@code b}.

@throws ArithmeticException if {@code a} or {@code b} is equal to
{@code Long.MIN_VALUE}.
Returns the least common multiple of the absolute value of the given two numbers . This method first computes the absolute values of the given numbers thus it doesn t accept { @code Long . MIN_VALUE } . Also note that if one of the given values is { @code 0 } this method will return the absolute value of the second argument . This method uses the formula { @code lcm ( a b ) = ( a / gcd ( a b )) * b } . Please refer to <a href = http : // en . wikipedia . org / wiki / Least_common_multiple > Wikipedia< / a > for further information .