The str
method for objects of class
mpfr
produces a bit more useful output than
the default method str.default
.
# S3 method for mpfr
str(object, nest.lev, internal = FALSE,
give.head = TRUE, digits.d = 12, vec.len = NULL, drop0trailing=TRUE,
width = getOption("width"), ...)
an object of class mpfr
.
for str()
, typically only used when
called by a higher level str()
.
logical indicating if the low-level internal structure
should be shown; if true (not by default), uses str(object@.Data)
.
logical indicating if the “header” should be printed.
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.
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).
logical, passed to formatMpfr()
(with a
different default here).
the (approximately) desired width of output, see
options(width = .)
.
further arguments, passed to formatMpfr()
.
.mpfr2list()
puts the internal structure into a
list
, and its help page documents many more (low level) utilities.
(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) # very similar to just 'uu'
Run the code above in your browser using DataLab