Skip to contents

The leading partial quotients [3; 7, 15, 1, 292, ...] are tabulated rather than derived: a double cannot supply them past the tenth, so asking for more than fifteen is refused instead of answered with noise. The early convergents are the classical 22/7, 333/106 and 355/113.

Usage

Conti(n)

Arguments

n

Number of partial quotients, 1 to 15.

Value

Named list with estimate, terms, convergents, numerator, denominator, error, n, method.

References

Classical; no single owning source.

Examples

Conti(4)
#> $estimate
#> [1] 3.141593
#> 
#> $terms
#> [1]  3  7 15  1
#> 
#> $convergents
#>       hs  ks
#> [1,]   3   1
#> [2,]  22   7
#> [3,] 333 106
#> [4,] 355 113
#> 
#> $numerator
#> [1] 355
#> 
#> $denominator
#> [1] 113
#> 
#> $error
#> [1] 2.667642e-07
#> 
#> $n
#> [1] 4
#> 
#> $method
#> [1] "continued fraction convergents of pi"
#>