Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!rutgers!att!akgua!brb From: brb@akgua.ATT.COM (Brian R. Bainter) Newsgroups: comp.lang.c Subject: Re: Absolute size of 'short' Message-ID: <1810@akgua.ATT.COM> Date: 2 Aug 88 17:43:26 GMT References: <214@ISIDAPS5.UUCP> Organization: AT&T Network Systems/Bell Labs, Atlanta GA Lines: 22 From article <214@ISIDAPS5.UUCP>, by mike@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