Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - factorial() compute the factorial of a number http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 factorial()         Compute the factorial of a number
------------------------------------------------------------------------------
 Declaration
   math.hdr

 Syntax
   proc factorial extern
   param       dbl  eResult, ;
         value uint uFactorial

 Arguments
   eResult receives the result of calculation.
   uFactorial is the factorial number.

 Return
   None.

 Description
   The function calculates the factorial of uFactorial.

 Example
   #define EXAMPLE_MATH
   #include example.hdr

   proc Test_factorial
   vardef
      dbl eNum
   enddef
   factorial( eNum, 11.0 )
   ? eNum                         // 39916800
   factorial( eNum, 5.0 )
   ? eNum                         // 120
   factorial( eNum, 7.0 )
   ? eNum                         // 540
   endproc

   proc main
   Test_factorial()
   endproc

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson