Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #5185

Re: '5'-'0' = 5 alway? guaranteed?

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date Thu, 19 May 2011 15:21:34 -0500
From Pete Becker <pete@versatilecoding.com>
Organization Roundhouse Consulting, Ltd.
Newsgroups comp.lang.c++
Date Thu, 19 May 2011 16:21:34 -0400
Message-ID <2011051916213466006-pete@versatilecodingcom> (permalink)
References <t_dBp.16910$7H.13151@newsfe08.ams2> <ir3qlq$a84$1@dont-email.me> <vieBp.666$Ky.145@newsfe24.ams2> <4dd5764b$0$2413$cc2e38e6@news.uslec.net>
MIME-Version 1.0
Content-Type text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding 8bit
Subject Re: '5'-'0' = 5 alway? guaranteed?
User-Agent Unison/2.1.4
Lines 34
X-Usenet-Provider http://www.giganews.com
X-Trace sv3-lM0g2izT1zkIOCl7RRoFeIqLukBWK0//hpEfu9yBVXXPvpQqMFP5tLm13pwsSsKB64wF174UsaFrTwh!U9rgrvKCGjGHLf8dxbjj59cXopeNRDcdsmAo9bNFxDTMtjUG8zN58qE3/2SoG1Pm83qRiwUA
X-Complaints-To abuse@giganews.com
X-DMCA-Notifications http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 2358
Xref x330-a1.tempe.blueboxinc.net comp.lang.c++:5185

Show key headers only | View raw


On 2011-05-19 15:58:29 -0400, Noah Roberts said:

> On 5/19/2011 12:35 PM, crea wrote:
>> "Alf P. Steinbach /Usenet"<alf.p.steinbach+usenet@gmail.com>  wrote in
>> message news:ir3qlq$a84$1@dont-email.me...
>>> * crea, on 19.05.2011 21:13:
>>>> I am just programming this kind of thing, and was wondering I according
>>>> to
>>>> c++ language it is always guaranteed that
>>>> '5'-'0' = 5. Character calculations. Because character should be in order
>>>> isnt it? Is it guaranteed that they are in order and the difference is 1?
>>> 
>>> Yes.
>>> 
>>> But that does not hold for letters (which are discontiguous in EBCDIC,
>>> which the C++ standard "must" support).
>>> 
>> 
>> ok, good to know also the letter-thing.
>> 
>> 
> 
> He's wrong actually.  It's a really good bet, but by no means guaranteed.

The character representations of the digits 0-9 are required to be 
contiguous and in ascending order. And there's no similar requirement 
for any other characters.

-- 
  Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The 
Standard C++ Library Extensions: a Tutorial and Reference 
(www.petebecker.com/tr1book)

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

'5'-'0' = 5 alway? guaranteed? "crea" <no@invalid.com> - 2011-05-19 20:13 +0100
  Re: '5'-'0' = 5 alway? guaranteed? "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-05-19 21:28 +0200
    Re: '5'-'0' = 5 alway? guaranteed? "crea" <no@invalid.com> - 2011-05-19 20:35 +0100
      Re: '5'-'0' = 5 alway? guaranteed? Noah Roberts <dont@email.me> - 2011-05-19 12:58 -0700
        Re: '5'-'0' = 5 alway? guaranteed? Victor Bazarov <v.bazarov@comcast.invalid> - 2011-05-19 16:10 -0400
        Re: '5'-'0' = 5 alway? guaranteed? Pete Becker <pete@versatilecoding.com> - 2011-05-19 16:21 -0400
          Re: '5'-'0' = 5 alway? guaranteed? "crea" <no@invalid.com> - 2011-05-19 21:24 +0100
        Re: '5'-'0' = 5 alway? guaranteed? "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-05-20 00:39 +0200

csiph-web