Signed and Unsigned Integers

The XDR standard defines signed integers as integer. A signed integer is a 32-bit datum that encodes an integer in the range [-2147483648 to 2147483647]. An unsigned integer is a 32-bit datum that encodes a nonnegative integer in the range [0 to 4294967295].

The signed integer is represented in twos complement notation. The most significant byte is 0 and the least significant is 3.

The unsigned integer is represented by an unsigned binary number whose most significant byte is 0; the least significant is 3. See the Signed Integer and Unsigned Integer figure (Figure 1).

Figure 1. Signed Integer and Unsigned Integer
This diagram shows the most significant byte on the left, which is byte 0. To the right of byte 0, is byte 1, followed by byte 2, and then byte 3 (the least significant byte). The length of the 4 bytes is 32 bits.