delorie.com/archives/browse.cgi | search |
X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f |
From: | Mok-Kong Shen <mok-kong DOT shen AT t-online DOT de> |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: bit shifting problem |
Date: | Thu, 10 Feb 2005 11:27:13 +0100 |
Organization: | T-Online |
Lines: | 16 |
Message-ID: | <cufcpq$6g2$03$1@news.t-online.com> |
References: | <cue1dv$n1b$00$1 AT news DOT t-online DOT com> |
Mime-Version: | 1.0 |
X-Trace: | news.t-online.com 1108031098 03 6658 qTeQrrFlFKikQ+V 050210 10:24:58 |
X-Complaints-To: | usenet-abuse AT t-online DOT de |
X-ID: | Tbk4fGZYZeVXjGwlkmseAOy2uATKnP+fvfqGAoEuevw8Lfodza7gE5 |
User-Agent: | Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) |
X-Accept-Language: | en-us, en |
In-Reply-To: | <cue1dv$n1b$00$1@news.t-online.com> |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
Errors-To: | nobody AT delorie DOT com |
X-Mailing-List: | djgpp AT delorie DOT com |
X-Unsubscribes-To: | listserv AT delorie DOT com |
Mok-Kong Shen wrote: > > Sorry for posing yet another, possibly also newbie, problem. > In the following code I expected the values of k and n to be > both 0, since shifting 32 bits for a 32-bit word effectively > clears it. ......... [snip] Apology. I have known the answer. Shifting by 32 for a 32-bit quantity is undefined in the standard. gcc simply does nothing in this situation, both for the left and the right shift. M. K. Shen
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |