 |
 |
Archives of the TeradataForum
Message Posted: Mon, 19 Sep 2005 @ 10:50:23 GMT
Subj: | | Re: Factorial in Teradata |
|
From: | | McCall, Glenn David |
You could write a UDF, you could also create a table and lookup the value.
The table would have two columns one for n and one for factorial n. For example
n factorial
0 1
1 1
2 2
3 6
etc
What sort of numbes are you dealing with? Integers? If so, you won't get very far. Integers are 32 bit so the largest factorial you could store
is 12! = 479,001,600. 13! is 6,227,020,800 which is roughly 3 times the value of the largest integer.
Glenn Mc
| |