Package 'go2bigq'

Title: Convert Large Numbers to Bigq Format
Description: This function converts mfpr, numeric, or character strings representing numbers to bigq format without loss of precision.
Authors: Carl Witthoft [aut, cre]
Maintainer: Carl Witthoft <[email protected]>
License: LGPL-3
Version: 2.0.1
Built: 2024-12-06 06:28:39 UTC
Source: CRAN

Help Index


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 [email protected]


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 numeric, mpfr, mpfr1, or character. A list containing any one of these classes is allowed. See Details for various limitations

...

Parameters which could be used to modify the default behavior of formatMpfr. See Details for more information.

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, [email protected]

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])