Topic: Integer limits


Author: folsom@ix.netcom.com (Alan Folsom)
Date: 1997/03/18
Raw View
Amidst some much more interesting discussions, I have what is probably
a stupid question.  If so, would someone kindly hit me over the head
with a 2x4 and point me at what I'm missing?

The C standard specifies minimum ranges for the various basic
arithmetic types, -32767 to +32767 for signed shorts, and so forth.  I
can certainly find in the draft standard where to get the
implementation's limits, but I can't see a requirement for mimimum
values.  Is there one?  Where is it defined, or could a conforming
implementation really have 16 bit shorts, ints, and longs?

Now, back to the interesting stuff...

Al Folsom
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]





Author: fjh@murlibobo.cs.mu.OZ.AU (Fergus Henderson)
Date: 1997/03/19
Raw View
folsom@ix.netcom.com (Alan Folsom) writes:

>The C standard specifies minimum ranges for the various basic
>arithmetic types, -32767 to +32767 for signed shorts, and so forth.  I
>can certainly find in the draft standard where to get the
>implementation's limits, but I can't see a requirement for mimimum
>values.  Is there one?

Yes, the minimum values for C++ are the same as for C.

>Where is it defined

In the C standard, which is included "by reference" in the C++ draft.
See 17.2.1.4 [lib.structure.see.also].

--
Fergus Henderson <fjh@cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3         |     -- the last words of T. S. Garp.
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]