The compiler determines the inner-dmax and outer-dmax values for an intrinsic function from the characteristics of the function.
Integer intrinsic functions return an integer; thus their outer-dmax is always zero. For those integer functions whose arguments must all be integers, the inner-dmax is thus also always zero.
The following table summarizes the inner-dmax and the precision of the function result.
| Function | Inner-dmax | Digit precision of function result |
|---|---|---|
| DATE-OF-INTEGER | 0 | 8 |
| DATE-TO-YYYYMMDD | 0 | 8 |
| DAY-OF-INTEGER | 0 | 7 |
| DAY-TO-YYYYDDD | 0 | 7 |
| FACTORIAL | 0 | 30 in compatibility mode, 31 in extended mode |
| INTEGER-OF-DATE | 0 | 7 |
| INTEGER-OF-DAY | 0 | 7 |
| LENGTH | n/a | 9 |
| MOD | 0 | min(i1 i2) |
| ORD | n/a | 3 |
| ORD-MAX | 9 | |
| ORD-MIN | 9 | |
| YEAR-TO-YYYY | 0 | 4 |
| INTEGER | For a fixed-point argument: one more digit than in the argument. For a floating-point argument: 30 in compatibility mode, 31 in extended mode. | |
| INTEGER-PART | For a fixed-point argument: same number of digits as in the argument. For a floating-point argument: 30 in compatibility mode, 31 in extended mode. |
A mixed intrinsic function is a function whose result type depends on the type of its arguments. A mixed function is fixed point if all of its arguments are numeric and none of its arguments is floating point. (If any argument of a mixed function is floating point, the function is evaluated with floating-point instructions and returns a floating-point result.) When a mixed function is evaluated with fixed-point arithmetic, the result is integer if all of the arguments are integer; otherwise, the result is fixed point.
For the mixed functions MAX, MIN, RANGE, REM, and SUM, the outer-dmax is always equal to the inner-dmax (and both are thus zero if all the arguments are integer). To determine the precision of the result returned for these functions, apply the rules for fixed-point arithmetic and intermediate results (as referred to below) to each step in the algorithm.
related references
Terminology used for intermediate results
Fixed-point data and intermediate results
Floating-point data and intermediate results
ARITH