Rational Developer for System z
COBOL for Windows, Version 7.5, Language Reference


FACTORIAL

The FACTORIAL function returns an integer that is the factorial of the argument specified.

The function type is integer.

Format
Read syntax diagramSkip visual syntax diagram>>-FUNCTION FACTORIAL--(--argument-1--)------------------------><
 
argument-1
If the ARITH(COMPAT) compiler option is in effect, argument-1 must be an integer greater than or equal to zero and less than or equal to 28. If the ARITH(EXTEND) compiler option is in effect, argument-1 must be an integer greater than or equal to zero and less than or equal to 29.

If the value of argument-1 is zero, the value 1 is returned; otherwise, the factorial of argument-1 is returned.


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)