Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!genrad!teddy!panda!talcott!harvard!seismo!brl-tgr!tgr!jon@cit-vax From: jon@cit-vax (Jonathan P. Leech) Newsgroups: net.unix-wizards Subject: Re: integer types, sys calls, and stdio Message-ID: <7315@brl-tgr.ARPA> Date: Mon, 14-Jan-85 15:06:31 EST Article-I.D.: brl-tgr.7315 Posted: Mon Jan 14 15:06:31 1985 Date-Received: Sun, 20-Jan-85 01:39:57 EST Sender: news@brl-tgr.ARPA Organization: Ballistic Research Lab Lines: 26 In article <631@turtlevax.UUCP>, Ken Turkowskiwrites: > Chars have always been 8 bits, shorts always 16, and longs always 32. > I would suggest that you keep as close to this as possible. Int has > varied between 16 and 32 bits; hell, why not make it 64? :-) > viz, > > char = 9 bits (S-1 quarterword) > short = 18 bits (S-1 halfword) > long = 36 bits (S-1 singleword) > int = 72 bits (S-1 doubleword) > > -- > Ken Turkowski @ CADLINC, Menlo Park, CA Why not? Perhaps Appendix A, section 4 (p. 182) of K&R: "Up to three sizes of integer, declared short int, int, and long int, are available. Longer integers provide no less storage than shorter ones." Also, if you apply the type conversion rules in section 6.6, an operation involving a (36 bit) long and a (72 bit) int will have result type of long, losing precision. Does anyone know what the ANSI standard says about this? Jon Leech jon@cit-vax.arpa