Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Language Reference


FACTORIAL

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

The function type is integer.

Read syntax diagramSkip visual syntax diagram
Format

>>-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

This information center is powered by Eclipse technology. (http://www.eclipse.org)