Supported RPG Features

Numeric comparisons (=, <>, <, >, <=, >=, and the fixed-format COMP / CABxx / CASxx operations) compare algebraic values aligned at the decimal point, matching IBM i. Neither operand's declared length nor its number of decimal positions affects the outcome, and the two operands need not share a data type: an INT/UNS field compared against a PACKED, ZONED, binary or float operand - or against a literal with a fractional part - keeps the partner's decimal positions rather than truncating them. So with I an INT(10) holding 2 and P a PACKED(5:2) holding 2.5, I < P and I < 2.5 are both true and I = 2.5 is false.

An UNS(20) operand compares by its full unsigned magnitude, so a value at or above 2^63 is the largest, not the smallest.