Rmpfr (version 0.7-2)

str.mpfr: Compactly Show STRucture of Rmpfr Number Object

Description

The str method for objects of class '>mpfr produces a bit more useful output than the default method str.default.

Usage

# S3 method for mpfr
str(object, nest.lev, internal = FALSE,
    give.head = TRUE, digits.d = 12, vec.len = NULL, drop0trailing=TRUE,
    width = getOption("width"), …)

Arguments

object

an object of class '>mpfr.

nest.lev

for str(), typically only used when called by a higher level str().

internal

logical indicating if the low-level internal structure should be shown; if true (not by default), uses str(object@.Data).

give.head

logical indicating if the “header” should be printed.

digits.d

the number of digits to be used, will be passed formatMpfr() and hence NULL will use “as many as needed”, i.e. often too many. If this is a number, as per default, less digits will be used in case the precision (getPrec(object)) is smaller.

vec.len

the number of elements that will be shown. The default depends on the precision of object and width (since Rmpfr 0.6-0, it was 3 previously).

drop0trailing

logical, passed to formatMpfr() (with a different default here).

width

the (approximately) desired width of output, see options(width = .).

further arguments, passed to formatMpfr().

See Also

mpfrIs0 for many more utilities.

Examples

Run this code
# NOT RUN {
(x <- c(Const("pi", 64), mpfr(-2:2, 64)))
str(x)
str(list(pi = pi, x.mpfr = x))
str(x ^ 1000)
str(x ^ -1e4, digits=NULL) # full precision

str(x, internal = TRUE) # internal low-level (for experts)

uu <- Const("pi", 16)# unaccurate
str(uu) # not using default of 12 digits
# }

Run the code above in your browser using DataLab