Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Tom Rettigs Library - fact(<expn>) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FACT(<expN>)
 Evaluates the factorial of number.
 Returns <expN> product of all numbers between <expN> and 1.

 Returns INFINITY() if <expN> is 19 or greater, or zero if <expN>
 is less than or equal to zero.

 Because factorials grow very quickly, the results returned by
 this function lose their precision, and therefore their value,
 when <expN> reaches 19.  For this reason, the function returns
 INFINITY() when <expN> equals or exceeds this number.

 m_number = 15
 IF FACT( m_number ) = INFINITY()
    ? "Number is too large to compute its factorial"
 ELSE
    ? FACT( m_number )
 ENDIF


             Placed in the Public Domain by Tom Rettig Assoc.

See Also: INFINITY()

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