{ Calculate a factorial of a number. For exmaple, to calculate a factorial of 100000, run query: x:.L & x:=0 & Factorial(100000,x) Note: Make sure you compile with enabled garbage collection, otherwise you may get run-time memory out of memory errors. To fully savor the size of the result, TTY settings should have "Wrap Lines" enabled and height hundreds of lines. } proc Factorial(x:<I,yy:.L) iff if x > 0 then Factorial(x-1,yy) & yy := yy*x & if x mod 100 = 0 then {show progress} Print('\r',x) end else yy := 1 end
This page was created by F1toHTML