big: Add Python implementation of LCM.

This commit is contained in:
Jeroen van Rijn
2021-09-07 14:17:14 +02:00
parent abb15ddb38
commit fbebf4bc4e
2 changed files with 44 additions and 19 deletions
+2 -2
View File
@@ -1642,8 +1642,8 @@ _private_int_gcd_lcm :: proc(res_gcd, res_lcm, a, b: ^Int, allocator := context.
/*
Store quotient in `t2` such that `t2 * a` is the LCM.
*/
internal_div(res_lcm, a, temp_gcd_res) or_return
err = internal_mul(res_lcm, res_lcm, b)
internal_div(res_lcm, b, temp_gcd_res) or_return
err = internal_mul(res_lcm, res_lcm, a)
}
if res_gcd != nil {