Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 19 Sep 2005 @ 10:50:23 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


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



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023