From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,INVALID_MSGID, PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,4873305131bf4d94 X-Google-Attributes: gid109fba,public X-Google-Thread: fdb77,4873305131bf4d94 X-Google-Attributes: gidfdb77,public X-Google-Thread: 103376,4873305131bf4d94 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,4873305131bf4d94 X-Google-Attributes: gid1014db,public From: ecl6rsh@leeds.ac.uk (R S Haigh) Subject: Re: How big is an int? (was: Yet another stupid language war (was: ... the only languages you need!!)) Date: 1997/11/06 Message-ID: <1997Nov6.124038.1917@leeds.ac.uk>#1/1 X-Deja-AN: 287411949 References: <34557f2b.1934172@news.mindspring.com> <878763380snz@genesis.demon.co.uk> Organization: University of Leeds, UK Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.java.advocacy Originator: ecl6rsh@sun.leeds.ac.uk (R S Haigh) Date: 1997-11-06T00:00:00+00:00 List-Id: In article <878763380snz@genesis.demon.co.uk>, fred@genesis.demon.co.uk (Lawrence Kirby) writes: > >I even had one person in the past try and tell me that when Intel went to > >64bits, that M$ was going to have: > > > > short = 2 bytes > > long = 4 bytes > > int = 8 bytes > > That would be possible but then the int would have to have unused bits > ("holes", which the standard permits), which makes it rather pointless. > int isn't allowed to represent a greater range than long. Not altogether pointless. The right time to use int is when you want a range of +-32767, but you want to store the value in the machine word size rather than the space-efficient size (short). That's just what this supports. Any other scheme frustrates what was presumably the programmer's intention in choosing int. --