On 11/3/05, Leopold Toetsch <[EMAIL PROTECTED]> wrote:
> On Nov 3, 2005, at 20:49, Joshua Isom wrote:
>
> > I was trying to use bit shifting for division by multiples of two, but
> > if the shift amount is a multiple of the int size, it seems to fail to
> > shift the bits.  Here's some example code demonstrating it.
> >
> > .sub _main @MAIN
> >     .local int a, b, c
> >     print "a\tb\tc\n"
> >     a = 24
> >     b = 32
> >     c = a >> b
>
> Shifting anything by >= the bits of the int isn't portable nor
> specified.

Why isn't it specified?  It seems to me that it should be zero.

The result being zero is also portable.  Right-shifting only ever
makes the number smaller.

Luke

Reply via email to