-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ben said:
I don't think a UINT_MAX of 65537 is possible, is that just a
typo for 65535?
No, it was intended.
I didn't have a real implementation in mind, just something unusual that still
conforms to the standards. AFAIK, the standards don't specify that UINT_MAX must
be some power-of-two minus 1; they simply say that the minimum value for
UINT_MAX is 65535. So, I chose a value for UINT_MAX that is greater than 65535,
but less than 131072.
The scenario I was trying to invent was
a) a conforming implementation that
b) used a UINT_MAX > 65535
c) used a CHAR_BIT > 8
d) used padding bits in the storage of an int
such that the number of bits used to store the
significant value of the int is less than the number of bits
allocated in the int storage class.
Of course, I could have said that
"It is entirely possible to have (sizeof(int)*CHAR_BIT) == 24, but UINT_MAX
only 131071."
but that wouldn't been unusual enough a value.
- --
Lew Pitcher
IT Consultant, Enterprise Application Architecture,
Enterprise Technology Solutions, TD Bank Financial Group
(Opinions expressed are my own, not my employers')
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
iD8DBQFA6Zm9agVFX4UWr64RAgM/AKCt08HjV4bjGQkOI+PZw2uG/08FnQCfaI8E
sAaPz35go83+zfzdV1wLZd4=
=e7LU
-----END PGP SIGNATURE-----