shift left arithmetic

Andrew Koenig ark at alice.UUCP
Tue Sep 11 06:15:32 AEST 1990


In article <2098 at charon.cwi.nl>, aeb at 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 at europa.att.com



More information about the Comp.std.c mailing list