Supported RPG Features

The ** operator raises a value to a power. The result is fixed-point regardless of operand types.

DCL-S factor PACKED(15:8);
DCL-S rate   PACKED(11:8);
DCL-S nPmts  INT(10);

rate = 0.00458333;
nPmts = 360;

// Compound growth factor: (1 + r) ^ n
EVAL(H) factor = (1 + rate) ** nPmts;

The exponentiation operator can be used with integer or decimal exponents. Integer exponents produce exact results; fractional exponents use floating-point arithmetic.