🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2846

Re: Stuff C++ needs

#2846
From: Dr. Richard Botting
Date: Mon, 04 Dec 1995 16:30
63 lines
3226 bytes
Jerry Coffin (jcoffin@rmii.com) wrote:

: dick@silicon.csci.csusb.edu (Dr. Richard Botting) wrote:

: >The current drafts and all precvous C and C++ standards and K+R C
: >define something like this:
: >There  are  four  signed  integer  types:  "signed char", "short int",
: >  "int", and "long int." In this list, each type provides  at  least  as
: >  much storage as those preceding it in the list, but the implementation
: ...
: >They do not pecify or require any particular number of bits.

: They don't give the specificactions in terms of numbers of bits, but
: they require that all integer types use a "pure binary" representation,
: and they require at least the following ranges of each type:

: 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 )

This must be a later version than the working papers I've got available..
I searched for 32767 but did not extract this info.

Personally.... I need a language where I know what I'm getting, so I
would be very much in favor having something like this in the C++
Standard.  There is something medieval about fundamental units being
variable... 3 grains of wheat laid end to end make one inch!

: AFAIK, these ranges require the previously posted number of bits to
: represent.  
You are absolutely right,

However, you mentioned:
: and they require at least the following ranges of each type:
Does this allow someone to have larger ranges (more bits)?
For example 66 bit ints (the fastest fixed point on a CDC Cyber)
certainly includes: -32767 .. 32767

I hope not... 

Any way I guess we can always
	enum{ lo=-32767, hi=32767} signed16bit;
and so on?

--
	dick@csci.csusb.edu=rbotting@wiley.csusb.edu.
Find out what's new at http://www.csci.csusb.edu/doc/www.sites.html
Disclaimer:`CSUSB may or may not agree with this message`.
Copyright(1995):Copy this freely but include the following link to the
<a href="http://www.csci.csusb.edu/dick/signature.html">author's signature</a>

[ 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: <49tnkd$rba@news.csus.edu>
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
References: <49lk0o$itd@engnews1.eng.sun.com> <49q17v$936@news.csus.edu> <49rja2$5du@natasha.rmii.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
From: dick@silicon.csci.csusb.edu (Dr. Richard Botting)
Newsgroups: comp.std.c++
Subject: Re: Stuff C++ needs
Date: 4 Dec 1995 16:30:23 GMT
Organization: CS Dept., Calif. State Univ., San Bernardino
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <49tnkd$rba@news.csus.edu>
References: <49lk0o$itd@engnews1.eng.sun.com> <49q17v$936@news.csus.edu> <49rja2$5du@natasha.rmii.com>
NNTP-Posting-Host: taumet.eng.sun.com
Content-Type: text
X-Nntp-Posting-Host: dick%@blaze.csci.csusb.edu
X-Newsreader: TIN [version 1.2 PL2]
Content-Length: 2298
X-Lines: 59
Originator: clamage@taumet