How can we calculate the factorial of 10000 (10000!) ?

Using the rational operation mode, we can calculate 10000! with the following program.

10 OPTION ARITHMETIC RATIONAL
20 PRINT FACT(10000)
30 END

When you check "Word Wrap" on the "Edit" menu of the Output window, the whole result can be seen.

As the rational operation mode has no limit of digits, calculation of larger numbers can be done, but they take more time.
For example, it takes 0.5 seconds to calculate 10000!, and 77 seconds to calculate 100000! on a PC with Pentium 4, 2.8GHz.

If you want to have an estimation, it is convenient to run the following in the Decimal or Binary mode.

10 INPUT n
20 LET t=0
30 FOR i=1 TO n
40    LET t=t+LOG10(i)
50 NEXT i
60 PRINT 10^(FP(t)); "E";IP(t)
70 END




Back