Lcm returns the lcm of two numbers using the fact that lcm(a,b) * gcd(a,b) = | a * b |
(a, b int64)
| 8 | |
| 9 | // Lcm returns the lcm of two numbers using the fact that lcm(a,b) * gcd(a,b) = | a * b | |
| 10 | func Lcm(a, b int64) int64 { |
| 11 | return int64(math.Abs(float64(a*b)) / float64(gcd.Iterative(a, b))) |
| 12 | } |