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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,4873305131bf4d94 X-Google-Attributes: gid1014db,public X-Google-Thread: 109fba,4873305131bf4d94 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,4873305131bf4d94 X-Google-Attributes: gid103376,public From: Chris Brand Subject: Re: Porting Experiences (was Ada and Pascal etc ) Date: 1997/11/05 Message-ID: <3460CF02.3C99@ccgate.hac.com>#1/1 X-Deja-AN: 287247211 References: <345E3ACD.A15@gsg.eds.com> <878648818snz@genesis.demon.co.uk> <345F9728.D61@gsg.eds.com> <63p2g1$vnt$1@helios.crest.nt.com> Organization: Hughes Canada Systems Division Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++ Date: 1997-11-05T00:00:00+00:00 List-Id: Kaz Kylheku wrote: > > In article <345F9728.D61@gsg.eds.com>, > Shmuel (Seymour J.) Metz wrote: > >Lawrence Kirby wrote: > >> [big snip] > >> > >> 2. If the range is contained within -2147483647 to 2147483647 then you > >> use long. > >> [bigger snip] > > Look, if you find something factually wrong in a Lawrence Kirby posting, I > shall promptly mail you a lollipop! :) and in a differnet posting, Shmuel (Seymour J.) Metz wrote: >Kaz Kylheku wrote: >> [snip] >> >> C gives you a header, , which gives you the constants LONG_MIN >> and LONG_MAX. These tell you what the implementation's least and >> greatest values of type long are. These values are guaranteed to be >> at least -2^31+1 and 2^31-1 respectively. >> >> If you assume that the long type has a range that is no larger than this, >> you are OK. If you write your code under the assumption that the >> range is LONG_MIN to LONG_MAX, you are also OK. >> [another snip] So, Lawrance Kirby claims that -2147483647 to 2147483647 will fit in a long, while you claim that you can only rely on -2^31+1 to 2^31-1. Do I get a lollipop, or are you wrong ? -- Chris Stating my own opinions, not those of my company. [Ignore lines down here, they're just to satisfy my newsserver] | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |