create a cFracConvergents function
This commit is contained in:
@@ -47,13 +47,12 @@ func pell(cmd *cobra.Command, args []string) {
|
||||
period = 2 * r
|
||||
}
|
||||
|
||||
hch := gaussianBrackets(a0, big.NewInt(1), cycle(repetend))
|
||||
kch := gaussianBrackets(big.NewInt(1), big.NewInt(0), cycle(repetend))
|
||||
ch := cFracConvergents(a0, repetend)
|
||||
|
||||
for i := 1; true; i = (i + 1) % period {
|
||||
h, k := <-hch, <-kch
|
||||
r := <-ch
|
||||
if i == period-1 {
|
||||
fmt.Println(h, k)
|
||||
fmt.Println(r.Num(), r.Denom())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user