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:
- The size of pointers remains 32-bit.
- An integer constant has type long long int
only if it is suffixed by the letters ll.
- An integer constant with suffix ll has
type long long int or unsigned
long long int. An integer with suffix ull
or llu has type unsigned long
long int.
- Integral promotions are unchanged. Integral promotions
are not performed on long long ints.
- Conversion of an integral type to long long int
only occurs if one of the operands in the expression
being evaluated has type long long int.
- When a value of float type is converted
to long long type, the fractional part
is discarded. If the value of the integral part cannot be
represented by the long long int type,
the result is the maximum value of the long long
int type.
- When a value of long long int type is
converted to floating type, if the value being converted
is in the range of values that can be represented but
cannot be represented exactly, the result is either the
nearest higher or nearest lower value, depending on the
IEEE rounding mode. You set the compile-time IEEE
rounding mode with the -y compiler
option.
- For binary operators that expect operands of arithmetic
type, if either operand has type unsigned long
long int, the other operand is converted to unsigned
long long int. Otherwise, if either operand has
type long long int, the other operand is
converted to long long int.
- The maximum size of a bit-field remains 32-bit.
- A conversion specification may contain an optional ll,
specifying that a following d, i,
o, u, x,
or X conversion specifier applies to a long
long int or unsigned long long int
argument.
- For power alignment rules, long
long int identifiers and aggregates containing long
long int members are aligned on a 64-bit
boundary.
- For type-based aliasing, lvalues of type char,
unsigned char, long long int,
or unsigned long long int are considered
as possible aliases of a long long int
or unsigned long long int.
- The attribute listing will display long long integer for signed
long long int identifiers and unsigned long long
integer for long long int identifiers.
- In interlanguage calls, a C signed long long int
maps to a Fortran INTEGER*8 and an unsigned long
long int maps to a Fortran LOGICAL*8.
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