fact = function( n ) { if ( n < 2 ) { return 1.0; else return n*fact(n-1); } }; for ( i in 1:17000 ) { fact(50); }