Representation of Numeric Formats
Figure 1 shows what the decimal number 21544 looks like in various formats.
![Representation of the Number 21544 in each of the Numeric Formats](rpgrnrep.gif)
Note the following about the representations in the figure.
- To obtain the numeric value of a positive binary or integer number, unsigned number, add the values of the bits that are on (1), but do not include the sign bit (if present). For an unsigned number, add the values of the bits that are on, including the leftmost bit.
- The value 21544 cannot be represented in a 2-byte binary field even though it only uses bits in the low-order two bytes. A 2-byte binary field can only hold up to 4 digits, and 21544 has 5 digits.
Figure 2 shows the number -21544 in integer format.
![Integer Representation of the Number -21544](rpgrneg.gif)