We don't need a loop!

require(Rmpfr)
factorial(mpfr(1:500,3800))


2011/2/2 Waclaw Kusnierczyk <w...@idi.ntnu.no>

>
> library(bc)
> factorial = function(n) bc(sprintf('
>    define factorial(n) {
>        if (n < 2) return (1)
>        f = 2
>        i = 2
>        while (i < n) f *= ++i
>        return (f) }
>    factorial(%d)', n))
>
>
-- 
Mi³ego dnia

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to