Xref: utzoo comp.lang.c:31742 comp.std.c:3578 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!wuarchive!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!att!dptg!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c,comp.std.c Subject: Re: shift left arithmetic Message-ID: <11317@alice.UUCP> Date: 10 Sep 90 20:15:32 GMT References: <2098@charon.cwi.nl> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 13 In article <2098@charon.cwi.nl>, aeb@cwi.nl (Andries Brouwer) writes: > While debugging an Australian computer algebra package > I stumbled over the following: 1<<32 produced 0, but > int a; a=1; a<<32 produced 1. (Of course the word length > of my machine is 32 bits.) On a machine with 32-bit words, a program that shifts a vlaue by 32 bits is illegal and the implementation is allowed to do whatever it likes. -- --Andrew Koenig ark@europa.att.com