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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,582dff0b3f065a52 X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,582dff0b3f065a52 X-Google-Attributes: gid1014db,public X-Google-ArrivalTime: 2001-08-28 16:17:50 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!jfk3-feed1.news.digex.net!intermedia!tor-nx1.netcom.ca!tor-nn1.netcom.ca.POSTED!not-for-mail Message-ID: <3B8C26D8.9F7FE2B2@yahoo.com> From: Joe Maun Organization: H X-Mailer: Mozilla 4.77 [en] (Win95; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++ Subject: Re: Subtle Bugs, kudos Ada (was How Ada ...Red Code ...) References: <3B6555ED.9B0B0420@sneakemail.com> <87n15lxzzv.fsf@deneb.enyo.de> <3B672322.B5EA1B66@home.com> <4a885870.0108112341.7ce02ac0@posting.google.com> <3B834E5D.B0D26AB1@adaworks.com> <9lvsic$bet9s$1@ID-9852.news.dfncis.de> <9m0193$grs$1@bird.wu-wien.ac.at> <3B83F042.4CFB073D@home.com> <3B8462C8.5596C089@yahoo.com> <87n14nmbf8.fsf@deneb.enyo.de> <3B89A809.46083436@yahoo.com> <871ylxpxu6.fsf@deneb.enyo.de> <3B8AA131.3FCC0E9A@yahoo.com> <87g0ad44ab.fsf@deneb.enyo.de> <3B8B1130.97FFDD66@yahoo.com> <3B8BD171.32C155D2@yahoo.com> <_SRi7.115023$B37.2552767@news1.rdc1.bc.home.com> <3B8BED46.3DEE945B@yahoo.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 28 Aug 2001 19:18:48 -0400 NNTP-Posting-Host: 216.123.139.180 X-Complaints-To: abuse@attcanada.ca X-Trace: tor-nn1.netcom.ca 999040655 216.123.139.180 (Tue, 28 Aug 2001 19:17:35 EDT) NNTP-Posting-Date: Tue, 28 Aug 2001 19:17:35 EDT Xref: archiver1.google.com comp.lang.ada:12537 comp.lang.c:77300 comp.lang.c++:86318 Date: 2001-08-28T19:18:48-04:00 List-Id: Kaz Kylheku wrote: > > In article <3B8BED46.3DEE945B@yahoo.com>, Joe Maun wrote: > >Kaz Kylheku wrote: > > > >> The entire paragraph from C99 says this: > >> > >> The result of E1 >> E2 is right shifted E2 bit positions. > >> If E1 has an unsigned type, or if E1 has a signed type and > >> a nonnegative value, the value of the result is the integral > >> part of the quotient of E1 divided by the quantity, 2 raised to > >> the power of E2. If E1 has a signed type and a negative value, > >> the resulting value is implementation-defined. > >> > >> So you see, when the result is not implementation-defined, it is actually > >> defined *arithmetically* as the quotient of an integer division by a power > >> of two. > > > >The *value* is defined arithmetically, while the bit positions are > >defined in terms of bit-shifts. Both are properties of the shift > > Under ones' complement, the bit pattern 1111...111 is non-negative; Wrong. If it's not a trap representation it's *negative* zero (ISO/IEC 9899:1999 - 6.2.6.2[2]). > it represents the value zero. When this is right shifted by 1, it must > result in the value 0. Since it is a negative value, the resulting value is implementation-defined. The resulting bits must have the form ?111...11. > That value could be represented as 0000...00 > or 1111...11. > > What about the sign-magnitude zero, 1000...000? That too is negative zero, so the above applies. > When that is shifted > right, you can get 1000..000 or 0000..000. Is that a bit shift? You get ?100...00. > easily have specific text to that effect. As it stands, the general > text is at odds with the specific text for negative E1. The specific > text dominates. Is it really at odds with the specific text? Or can both be satisfied? I think both can be satisfied for reasons I have already mentioned. You think they are meant to be at odds. I don't think I have anything to add to this, so I probably won't, unless you come up with something really convincing. -- Joe Maun Montreal, QC Canada