Re: [CHALLENGE] finding rightmost zero bit



Bart Vandewoestyne wrote:
On 2005-08-29, glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx> wrote:

I would say that with the traditional 1 origin arrays that
it makes some sense to use 1 for the LSB.  In mine I return
0 for the case of no zero bits.


There is *always* a first rightmost zero bit!  So 0 is an answer
that is not possible here...

Oh? What about the machine word with all bits set to 1? For example, an 8 bit word with value 255? Or is one supposed to look outside the machine word to find the 0 bit which is "always there"?


N. Shamsundar
University of Houston


Suppose for example 3, being 11 in binary, or also being 011 in binary... so the index to be returned here is 3.

Regards,
Bart

.



Relevant Pages