rename var

This commit is contained in:
filifa 2025-08-11 23:11:15 -04:00
parent 217d71f3ba
commit fdd538632d
1 changed files with 5 additions and 5 deletions

View File

@ -32,7 +32,7 @@ func gcd(cmd *cobra.Command, args []string) {
var z big.Int var z big.Int
var w big.Int var w big.Int
coeffs := make([]big.Int, len(args)) bezouts := make([]big.Int, len(args))
for i, s := range args { for i, s := range args {
_, ok := w.SetString(s, 10) _, ok := w.SetString(s, 10)
@ -42,11 +42,11 @@ func gcd(cmd *cobra.Command, args []string) {
z.GCD(&x, &y, &z, &w) z.GCD(&x, &y, &z, &w)
for j, c := range coeffs { for j, c := range bezouts {
if j == i { if j == i {
coeffs[j].Set(&y) bezouts[j].Set(&y)
} else { } else {
coeffs[j].Mul(&c, &x) bezouts[j].Mul(&c, &x)
} }
} }
@ -54,7 +54,7 @@ func gcd(cmd *cobra.Command, args []string) {
fmt.Print(&z) fmt.Print(&z)
if extended { if extended {
for _, c := range coeffs { for _, c := range bezouts {
fmt.Printf(" %s", &c) fmt.Printf(" %s", &c)
} }
} }