name variables more clearly
This commit is contained in:
parent
654f0efc0a
commit
f740223d88
|
|
@ -23,18 +23,18 @@ import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
var a string
|
var jacobiTop string
|
||||||
var n string
|
var jacobiBottom string
|
||||||
|
|
||||||
func jacobi(cmd *cobra.Command, args []string) {
|
func jacobi(cmd *cobra.Command, args []string) {
|
||||||
x, ok := new(big.Int).SetString(a, 10)
|
x, ok := new(big.Int).SetString(jacobiTop, 10)
|
||||||
if !ok {
|
if !ok {
|
||||||
cobra.CheckErr("invalid input " + a)
|
cobra.CheckErr("invalid input " + jacobiTop)
|
||||||
}
|
}
|
||||||
|
|
||||||
y, ok := new(big.Int).SetString(n, 10)
|
y, ok := new(big.Int).SetString(jacobiBottom, 10)
|
||||||
if !ok {
|
if !ok {
|
||||||
cobra.CheckErr("invalid input " + n)
|
cobra.CheckErr("invalid input " + jacobiBottom)
|
||||||
}
|
}
|
||||||
|
|
||||||
mod := big.NewInt(2)
|
mod := big.NewInt(2)
|
||||||
|
|
@ -68,8 +68,8 @@ func init() {
|
||||||
// is called directly, e.g.:
|
// is called directly, e.g.:
|
||||||
// jacobiCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
// jacobiCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||||
|
|
||||||
jacobiCmd.Flags().StringVarP(&a, "residue", "a", "", "residue")
|
jacobiCmd.Flags().StringVarP(&jacobiTop, "residue", "a", "", "residue")
|
||||||
jacobiCmd.MarkFlagRequired("residue")
|
jacobiCmd.MarkFlagRequired("residue")
|
||||||
jacobiCmd.Flags().StringVarP(&n, "modulus", "n", "", "modulus")
|
jacobiCmd.Flags().StringVarP(&jacobiBottom, "modulus", "n", "", "modulus")
|
||||||
jacobiCmd.MarkFlagRequired("modulus")
|
jacobiCmd.MarkFlagRequired("modulus")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue