On big endian platforms,
the value 1 is stored in binary and is represented here in hexadecimal
notation. One byte is stored as 01, two bytes as 00 01, and four bytes
as 00 00 00 01. On little endian platforms, the value 1 is stored
in one byte as 01 (the same as big endian), in two bytes as 01 00,
and in four bytes as 01 00 00 00.
If an integer is negative,
the “two's complement” representation is used. The high-order
bit of the most significant byte of the integer will be set on. For
example, –2 would be represented in one, two, and four bytes
on big endian platforms as FE, FF FE, and FF FF FF FE respectively.
On little endian platforms, the representation would be FE, FE FF,
and FE FF FF FF. These representations result from the output of the
integer binary value –2 expressed in hexadecimal representation.