Implementation Dependency - Integers (F.3.5)

The following table shows the storage occupied and the range of various integer types. (3.1.2.5)

Type Size (bits) Range (in limits.h)
signed char 8 -(127 + 1) to 127
(unsigned) char 8 0 to 255
(signed) short 16 -(32767 + 1) to 32767
unsigned short 16 0 to 65535
(signed) int 32 -(2147483647 + 1) to 2147483647
unsigned int 32 0 to 4294967295
(signed) long 32 -(2147483647 + 1) to 2147483647
unsigned long 32 0 to 4294967295
(signed) long long 64 -(9223372036854775807 + 1) to 9223372036854775807
unsigned long long 64 0 to 18446744073709551615

When an integer is converted to a signed char, the lowest byte of the integer is used to represent the char. (3.2.1.2)

When an integer is converted to a shorter signed integer, the lowest 2 bytes of the integer are used to represent the short int. (3.2.1.2)

When an unsigned integer is converted to a signed integer of equal length, the bit pattern is preserved, and the high-order bit becomes the sign bit. (3.2.1.2)

Bitwise operations (Inclusive OR (|), AND (&), Exclusive OR (^)) on a signed integer use the bit pattern of the signed quantity. (3.3)

If either operand of integer division is negative, the result of the / operator is the largest integer less than or equal to the algebraic quotient. (3.3.5)

When a bitwise right shift (>>) of a negative signed integral type is used, vacated bits are filled with ones. (3.3.7) When a bitwise right shift () of a non-negative signed integral type or an unsigned integral type is used, vacated bits are filled with zeros.

When using long long in your programs, the following rules apply:

Other system limits are set in the /usr/include/sys/limits.h file. The limits.h header file is described in the Header Files Overview of the AIX Version 4 Files Reference.



Implementation-Defined Behavior
Implementation Dependencies
Type Conversions