From d372ab1391ff01242c5a5afcc197ecc38f68971c Mon Sep 17 00:00:00 2001 From: filifa Date: Mon, 18 Aug 2025 22:10:01 -0400 Subject: [PATCH] simplify a bit --- cmd/crt.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/crt.go b/cmd/crt.go index df46965..35bdac1 100644 --- a/cmd/crt.go +++ b/cmd/crt.go @@ -95,14 +95,15 @@ func crt(cmd *cobra.Command, args []string) { log.Fatal("invalid input " + remainders[i]) } - if i != 0 { - x, N := crtSolve(a1, n1, a2, n2) - n1.Set(N) - a1.Set(x) - } else { + if i == 0 { a1.Set(a2) n1.Set(n2) + continue } + + x, N := crtSolve(a1, n1, a2, n2) + a1.Set(x) + n1.Set(N) } fmt.Println(a1)