qsqrt | R Documentation |
Returns a rational approximation of the square root of an integer.
qsqrt(x, n) qsqrt2(n) qsqrt3(n) qsqrtPhi(n) ## S3 method for class 'qsqrt' print(x, ...)
x |
the positive integer whose square root is desired |
n |
a positive integer, the higher the better approximation |
... |
ignored |
The qsqrt
function returns a gmp rational number
(class bigq
) approximating the square root of
x
. The qsqrt2
, qsqrt3
, and qsqrtPhi
functions
return a gmp rational number approximating the square root of
2
, 3
, and phi
(the golden number) respectively.
Their value converge more fastly than the value obtained with qsqrt
.
library(Boov) qsqrt(2, 7) qsqrt2(7) qsqrt3(22) qsqrtPhi(17)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.