< Summary

Information
Class: /home/runner/work/SharpMathLib/SharpMathLib/SharpFractions/BigIntExtra.cs
Assembly: Default
File(s): /home/runner/work/SharpMathLib/SharpMathLib/SharpFractions/BigIntExtra.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 21
Line coverage: 100%
Branch coverage
100%
Covered branches: 8
Total branches: 8
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

File(s)

/home/runner/work/SharpMathLib/SharpMathLib/SharpFractions/BigIntExtra.cs

#LineLine coverage
 1namespace SharpFractions;
 2
 3public static class BigIntExtra
 4{
 5    /// <summary>
 6    /// Calculates the least common multiple of two BigInteger
 7    /// </summary>
 8    /// <param name="bigInt1"></param>
 9    /// <param name="bigInt2"></param>
 10    /// <returns></returns>
 11    /// <exception cref="ArgumentException"></exception>
 12    public static BigInteger LeastCommonMultiple (BigInteger bigInt1, BigInteger bigInt2)
 2413    {
 2514        if (bigInt1 == 0 && bigInt2 == 0) throw new ArgumentException("LCM(a, b) is ony defined when both a and b are no
 15
 2416        if (bigInt1 == 0) return 0;
 2317        if (bigInt2 == 0) return 0;
 18
 2119        return BigInteger.Abs(bigInt1 * bigInt2) / BigInteger.GreatestCommonDivisor(bigInt1, bigInt2);
 2320    }
 21}