A
Alf P. Steinbach /Usenet
In the C99 standard draft N869, §7.18.2.1,
minimum values of exact-width signed integer types
INTn_MIN exactly either 1-2^(n-1) or -2^(n-1)
where the first possibility is sign-and-magnitude and one's complement, and the
second is for two's complement.
However,
http://en.wikipedia.org/wiki/Stdint.h#Exact-width_integer_types
claims that
intN_t must be encoded as a two's complement signed integer and uintN_t as an
unsigned integer
and later on goes into a discussion of how this guarantee can be troublesome.
To some degree that claim is corroborated by
http://www.opengroup.org/onlinepubs/9699919799/basedefs/stdint.h.html
which states that, for the [stdint.h] that it defines,
The typedef name int N _t designates a signed integer type with width N, no
padding bits, and a two's-complement representation.
but this may be just an additional Posix guarantee (although it's not marked as
such).
Which is correct wrt. to the C99 and C++0x [stdint.h]?
Cheers,
- Alf
minimum values of exact-width signed integer types
INTn_MIN exactly either 1-2^(n-1) or -2^(n-1)
where the first possibility is sign-and-magnitude and one's complement, and the
second is for two's complement.
However,
http://en.wikipedia.org/wiki/Stdint.h#Exact-width_integer_types
claims that
intN_t must be encoded as a two's complement signed integer and uintN_t as an
unsigned integer
and later on goes into a discussion of how this guarantee can be troublesome.
To some degree that claim is corroborated by
http://www.opengroup.org/onlinepubs/9699919799/basedefs/stdint.h.html
which states that, for the [stdint.h] that it defines,
The typedef name int N _t designates a signed integer type with width N, no
padding bits, and a two's-complement representation.
but this may be just an additional Posix guarantee (although it's not marked as
such).
Which is correct wrt. to the C99 and C++0x [stdint.h]?
Cheers,
- Alf