go2bigq {go2bigq} | R Documentation |
Function to convert various numerics to bigq
with full precision.
Description
Convert a numeric, a character string representing a numeric, or various mpfr
classes to a bigq
fraction. The output has the same precision as the input.
Usage
go2bigq(x, ...)
Arguments
x |
A value of class |
... |
Parameters which could be used to modify the default behavior of |
Details
The input x
, if a list, must contain only one of the allowed classes.
Character strings which represent numbers must be of the form [+,-]X[.]Y[e,E[+,-]Z], where X, Y, and Z are strictly limited to the numerals [0:9]. None of the other character options listed are required (except of course "[+,-]Z" is disallowed unless "[e,E]" exists.)
The function formatMpfr
accepts several arguments to adjust the output character string (number of digits precision, e.g.). go2bigq
passes the ...
objects to formatMpfr
.
Value
A bigq
object containing a vector of bigq
fractions .
Author(s)
Carl Witthoft, carl@witthoft.com
See Also
.bigq2mpfr
, .bigz2mpfr
, as.bigq
Examples
library(Rmpfr)
(go2bigq(0.17 + 1:5))
(go2bigq(as.character(0.17 + 1:5)))
(go2bigq(mpfr(0.17 + 1:5,100)))
as.numeric(go2bigq('017.3200e-10')[1] - go2bigq(0017.3200e-10)[1])