I use polymonial wrote multiplier and the product is in kind shown below:
Z=X.Y=X.(y(n-1).10^(n-1)+y(n-2).10^(n-2)+...+y(1).10^1+y(0).10^(0))=X.y(n-2).10^(n-2)+X.y(n-3).10^(n-3)+...+X.y(1).10^(1)+X.y(0).2^(0)
y(i) is consequtive digit of multiplier in n digits decimal area(i=0 is junior, i=n-1 is senior digit). The count of addends is equals to digits of the multiplier. The scheme I use is:
-------> ------>
---------------------- -----------------------------
| | | | |
---------------------- -----------------------------
transitory sum multiplier |-> y(i)
+
----------------------
| |
----------------------
multiplicant
in every step is forming product ((multiplicant).y(i)) and add the result to the current transitory sum (in the beggining transitory sum is 0), after that I shift transitory sum and multiplier one digit rigth-hand side and the operation repeate. After consideration of all multiplier digits, the transitory sum is final result.
In that way I forming multiplication to calculate factorial, but transitory sum grow bigger ang bigger and I use string for its representation. When I need to process it I work in portions that could be represent in C# long int type, and after that every portion is again transfrom in string that is put into string represented transitory sum. Moreover multiplier and multiplicant grow up too in the process of factorial calculation, so I need to represent them like a strings too. Frequently transform from string to long int data type and back into the string is slow. But in truth also maybe I could consider some other algorithm to calculate factorial. But I need it to be accurate (not round).
QUOTE(NickDMax @ 17 Mar, 2007 - 10:25 PM)

well lets see mathematica does 1000! is well less then 1 second on my 2Ghz pc (my machine is very slow and old).
You are right that there are faster algorithems then just the standard recursive ones.
Now these numbers don't fit into a double: 1000! ruffly = 4.0238726x10^2567
so you need to think about the format you want the number in as that has a lot to do with how you will construct the algorithm.
I know of two aproches. One is to view the thing as a polynomial and use the polynomial algorithm. The other does a ruff and dirty factorization and uses the pow() function to cut down on the multiplications.