public static BigInteger LeastCommonMultiple(this BigInteger a, BigInteger b) { Extreme.Mathematics.BigInteger emA = ToUnsignedExtremeMathematics(a); Extreme.Mathematics.BigInteger emB = ToUnsignedExtremeMathematics(b); Extreme.Mathematics.BigInteger result = IntegerMath.LeastCommonMultiple(emA, emB); return(ToUnsignedBigInteger(result)); }
public void LeastCommonMultipleBigInteger() { BigInteger a = 2 * 3 * 5 * 7; BigInteger b = 3 * 5 * 11; BigInteger c = 3 * 5 * 13; BigInteger expected = 2 * 3 * 5 * 7 * 11 * 13; BigInteger actual = IntegerMath.LeastCommonMultiple(a, b, c); Assert.AreEqual(expected, actual); }
public void LeastCommonMultipleLong() { long a = 2 * 3 * 5 * 7; long b = 3 * 5 * 11; long c = 3 * 5 * 13; long expected = 2 * 3 * 5 * 7 * 11 * 13; long actual = IntegerMath.LeastCommonMultiple(a, b, c); Assert.AreEqual(expected, actual); }