From fbebf4bc4e042986ff834587be04eb43c240302f Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Tue, 7 Sep 2021 14:17:14 +0200 Subject: big: Add Python implementation of LCM. --- core/math/big/private.odin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/math/big/private.odin') diff --git a/core/math/big/private.odin b/core/math/big/private.odin index b3d4d80e5..14a27f600 100644 --- a/core/math/big/private.odin +++ b/core/math/big/private.odin @@ -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 { -- cgit v1.2.3