Skip to content
Prev 246864 / 398506 Next

how to calculate this natural logarithm

You could re-do part of your code to run with mpfr-class variables, and  use
   this function:
   # mpfr choose(n,k)
    rmpfac<-function(n,k,prec=50)
   factorial(mpfr(n,prec))/factorial(mpfr(k,prec))/factorial(mpfr(n-k,prec))
   Converting into and out of mpfr may not be worth it, but you will get all
   the precision you want without any nasty "Inf" results
   :-)
   Carl