simplify a bit

This commit is contained in:
filifa 2025-08-18 22:10:01 -04:00
parent 56d7a84dcf
commit d372ab1391
1 changed files with 6 additions and 5 deletions

View File

@ -95,14 +95,15 @@ func crt(cmd *cobra.Command, args []string) {
log.Fatal("invalid input " + remainders[i]) log.Fatal("invalid input " + remainders[i])
} }
if i != 0 { if i == 0 {
x, N := crtSolve(a1, n1, a2, n2)
n1.Set(N)
a1.Set(x)
} else {
a1.Set(a2) a1.Set(a2)
n1.Set(n2) n1.Set(n2)
continue
} }
x, N := crtSolve(a1, n1, a2, n2)
a1.Set(x)
n1.Set(N)
} }
fmt.Println(a1) fmt.Println(a1)