Absolute size of 'short'
Brian R. Bainter
brb at akgua.ATT.COM
Wed Aug 3 03:43:26 AEST 1988
>From article <214 at ISIDAPS5.UUCP>, by mike at ISIDAPS5.UUCP (Mike Maloney):
> Dear C-Heavies,
>
> Is the size of a (signed or unsigned) short integer guarenteed to
> be two bytes? I need to manipulate and compare some unsigned ints
> modulo 65536. It would be clean and convenient to just let the
> machine handle my wrap-around from 0 to 0xffff and verse-vica.
I had always thought that short integers were always 16 bits (due
I suppose to my use of the language on a limited number of machines
no doubt). So when I saw your question, I decided to do some checking,
and sure enough on page 34 of K&R I was once again proven mistaken.
On a Honeywell 6300 a short is 36 bits. I also noticed that everything
except bytes and doubles were 36 bits. This is probably (and someone
correct me if I'm wrong - I have all the confidence that you will) due
to the "natural" word size for the processor.
--
Brian R. Bainter KA7TXA
AT&T Technologies Atlanta Works
{cbosgd, gatech, ihnp4, moss, mtune, ulysses}akgua!brb
More information about the Comp.lang.c
mailing list