How can I compute the range of signed and unsigned types

Chris Black cblack at
Wed Apr 18 11:26:33 EDT 2001

On Wed, Apr 18, 2001 at 02:19:11PM +0100, James Cownie wrote:
> All the C standard says is that
> 1) sizeof (char)  == 1
> 2) sizeof (short) >= sizeof (char)
> 3) sizeof (int)   >= sizeof (short)
> 4) sizeof (long)  >= sizeof (int)
> 5) sizeof (long long) >= sizeof (long).
> It also does not specify that the representation of an int is two's
> complement, so even on machines with the same sizeof(int) the legal
> ranges could differ.
Just out of curiosity, are there any machines currently is use that do 
NOT use two's complement? Do IEEE or C standards say anything about the 
size of the mantissa in floats?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <>

More information about the Beowulf mailing list