Perhaps I misunderstood what clz() does, but does the code you posted really work? It gives me 8 for $z=17. Shouldn't it be 27 for 32bit and 59 for 64bit? 17=10001 (with 59 leading zeros and MSB is at the zeros-side, left)
In reply to Re: Most Significant Set Bit
by bliako
in thread Most Significant Set Bit
by coldr3ality
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |