| Type: | Package |
| Title: | Convert Large Numbers to Bigq Format |
| Version: | 2.0.1 |
| Date: | 2023-08-28 |
| Description: | This function converts mfpr, numeric, or character strings representing numbers to bigq format without loss of precision. |
| License: | LGPL-3 |
| Imports: | Rmpfr, gmp, methods |
| NeedsCompilation: | no |
| Packaged: | 2023-08-28 14:58:46 UTC; cgw |
| Author: | Carl Witthoft [aut, cre] |
| Maintainer: | Carl Witthoft <cellocgw@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2023-08-29 18:10:11 UTC |
Convert Large Numbers to Bigq Format
Description
This function converts mfpr, numeric, or character strings representing numbers to bigq format without loss of precision.
Details
| Package: | go2bigq |
| Type: | Package |
| Version: | 2.0 |
| Date: | 2022-06-02 |
| License: | GPL-3 |
Author(s)
Carl Witthoft
Maintainer:Carl Witthoft carl@witthoft.com
Function to convert various numerics to bigqwith 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])