COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Example 188 DAY-OF-INTEGER Function
Code:
DISPLAY FUNCTION DAY-OF-INTEGER (1)
DISPLAY FUNCTION DAY-OF-INTEGER (365)
DISPLAY FUNCTION DAY-OF-INTEGER (36500)
DISPLAY FUNCTION DAY-OF-INTEGER (12345)
DISPLAY FUNCTION DAY-OF-INTEGER (100000)
Output:
1601001
1601365
1700341
1634292
1874289
FACTORIAL Function
FACTORIAL, an integer function, returns the factorial of its argument.
argument
is an integer greater than or equal to zero.
When argument is zero, the returned value is 1; when argument is positive, the returned value
is its factorial.
Example 189 FACTORIAL Function
Code:
DISPLAY FUNCTION FACTORIAL (0)
DISPLAY FUNCTION FACTORIAL (1)
DISPLAY FUNCTION FACTORIAL (4)
DISPLAY FUNCTION FACTORIAL (6)
DISPLAY FUNCTION FACTORIAL (10)
Output:
0000000000000000001
0000000000000000001
0000000000000000024
0000000000000000720
0000000000003628800
INTEGER Function
INTEGER, an integer function, returns the greatest integer that is less than or equal to its argument.
argument
is a numeric argument.
The returned value is the greatest integer that is less than or equal to the value of argument.
666 Intrinsic Functions










