Article View: comp.std.c++
Article #2859Re: Stuff C++ needs
From: James Kanze US/ESC 60/3/141 #407...
Date: Tue, 05 Dec 1995 16:20
Date: Tue, 05 Dec 1995 16:20
50 lines
2903 bytes
2903 bytes
In article <49tsg5$eqc@harbinger.cc.monash.edu.au>
kevinl@fangorn.cs.monash.edu.au (Kevin Lentin) writes:
|> Jerry Coffin (jcoffin@rmii.com) wrote:
|> >
|> > signed char -127 .. 127
|> > unsigned char 0 .. 255
|> > short -32767 .. 32767
|> > unsigned short 0 .. 65535
|> > int -32767 .. 32767
|> > unsigned 0 .. 65535
|> > long -214783647 .. 214783647
|> > unsigned long 0 .. 4294967295
|> >
|> > (With plain `char' having the same range as either `signed char' or
|> > `unsigned char', but being of a type distinct from either.)
|> > (ISO C: 5.2.4.2.1, referred to by r.2.3 and r.3.6.1 in C++PL2 )
|> >
|> > AFAIK, these ranges require the previously posted number of bits to
|> > represent. If you can show a way of representing these ranges in fewer
|> > bits, you have the foundation of the worlds greatest data compression
|> > algorithm...
|> I see no reference to this in the DWP. 3.9.1 [basic.fundamental] specifies
|> the ordering and it says that any of them can be equal in size as long as
|> none are smaller than the previous. It suggests that int would be the
|> natural size for the machine.
|> 18.2 [lib.support.limits] describes the <limits> header and the
|> numeric_limits class is in 18.2.1.1 which has to be specialised for builtin
|> types so you can use numeric_limits<int>.min() and .max().
And the very last sentance in 18.2.2 states: see also, with a list of
sections in ISO 9899. I don't have my copy of ISO 9899 here, but one
of these sections guarantees the minimum values stated above for
xxx_MAX and xxx_MIN.
If you read carefully, you'll find that an awful lot of ISO 9899 is
included by reference. Your DWP is not complete without it.
--
James Kanze Tel.: (+33) 88 14 49 00 email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs-Bourgeois, F-67000 Strasbourg, France
Conseils, études et réalisations en logiciel orienté objet --
-- A la recherche d'une activité dans une region francophone
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<9512051049.AA17727@lts.sel.alcatel.de>Path:
arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamageReferences:
<49lk0o$itd@engnews1.eng.sun.com> <49q17v$936@news.csus.edu> <49rja2$5du@natasha.rmii.com> <49tsg5$eqc@harbinger.cc.monash.edu.au>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage From: James Kanze US/ESC 60/3/141 #40763 <kanze@lts.sel.alcatel.de> Newsgroups: comp.std.c++ Subject: Re: Stuff C++ needs Date: 5 Dec 1995 16:20:35 GMT Organization: ? Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <9512051049.AA17727@lts.sel.alcatel.de> References: <49lk0o$itd@engnews1.eng.sun.com> <49q17v$936@news.csus.edu> <49rja2$5du@natasha.rmii.com> <49tsg5$eqc@harbinger.cc.monash.edu.au> NNTP-Posting-Host: taumet.eng.sun.com Content-Type: text In-Reply-To: kevinl@fangorn.cs.monash.edu.au's message of 04 Dec 1995 07:34:29 GMT Content-Length: 1981 Originator: clamage@taumet