dot-N: Use 'Rmpfr' to use mpfr-number instead of a simple number to...

.NR Documentation

Use Rmpfr to use mpfr-number instead of a simple number to be more accurate

Description

This wrapper comes pretty much straight from the vignette. When you need higher precision estimates than R will normally allow, this will help out.

By using Rmpfr, you can often call your R function or numerical code with mpfr–numbers instead of simple numbers, and all results will automatically be much more accurate.

Usage

.N(x, precBits = 200)

Arguments

x

A number or vector of numbers

precBits

a number, the maximal precision to be used, in bits; i.e. 53 corresponds to double precision. Must be at least 2. If missing, getPrec(x) determines a default precision.

Value

An mpfr-number or vector of mpfr-numbers

References

https://cran.r-project.org/web/packages/Rmpfr/vignettes/Maechler_useR_2011-abstr.pdf

Examples

options(digits = 17)  # to print to full "standard R" precision
exp(1)
exp(.N(1))


emilelatour/lamisc documentation built on April 9, 2024, 10:33 a.m.