## 30 digit precision
str(x <- mpfr(c(2:3, pi), prec = 30 * log2(10)))
x^2
x[1] / x[2] # 0.66666... ~ 30 digits
## factorial() and lfactorial() would work automagically via gamma();
## factorial() has method that rounds
f200 <- factorial(mpfr(200, prec = 1500)) # need high prec.!
f200
as.numeric(log2(f200))# 1245.38 -- need precBits >~ 1246 for full precision
## More extreme
f.1e4 <- factorial(mpfr(10000, prec=1+lfactorial(10000)/ log(2)))
getPrec(f.1e4) # 118459
str(f.1e4)Run the code above in your browser using DataLab