powered by
rat(x, tol = 1e-06) rats(x, tol = 1e-06)
1e-6
pi
rat
[b0; b1, ..., b_{n-1}]
rats prints the rational number and returns a numeric vector.
rats
numbers::contfrac
rat(pi) rats(pi) rat(sqrt(c(2, 3, 5)), tol = 1e-15) rats(sqrt(c(2, 3, 5)), tol = 1e-15)
Run the code above in your browser using DataLab