roundMpfr | R Documentation |
Rounding to binary bits, not decimal digits. Closer to the number
representation, this also allows to increase or decrease a number's
precBits. In other words, it acts as setPrec()
, see
getPrec()
.
roundMpfr(x, precBits, rnd.mode = c("N","D","U","Z","A"))
x |
an mpfr number (vector) |
precBits |
integer specifying the desired precision in bits. |
rnd.mode |
a 1-letter string specifying how rounding
should happen at C-level conversion to MPFR, see |
an mpfr number as x
but with the new 'precBits' precision
The mpfr
class group method Math2
implements a method for round(x, digits)
which rounds to
decimal digits.
(p1 <- Const("pi", 100)) # 100 bit prec
roundMpfr(p1, 120) # 20 bits more, but "random noise"
Const("pi", 120) # same "precision", but really precise
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.