We don't need a loop!

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


2011/2/2 Waclaw Kusnierczyk <waku@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]]

