From 5eefcb6b8de0470f26ce6ba0783b61acb9f2af19 Mon Sep 17 00:00:00 2001 From: Cristopher Namchee Date: Fri, 1 Dec 2023 11:15:37 +0700 Subject: [PATCH] fix: add n to the gcd function --- content/english/hpc/algorithms/factorization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/english/hpc/algorithms/factorization.md b/content/english/hpc/algorithms/factorization.md index b900eb8c..026e4439 100644 --- a/content/english/hpc/algorithms/factorization.md +++ b/content/english/hpc/algorithms/factorization.md @@ -302,7 +302,7 @@ u64 find_factor(u64 n) { while (g == 1) { x = f(f(x, n), n); // advance x twice y = f(y, n); // advance y once - g = gcd(diff(x, y)); + g = gcd(diff(x, y), n); } return g; }