I am only prototyping the pure Perl version for a C implementation.
If your doing it in C, it is very efficient compared to other methods; and works well as an Inline::C routine.
It originates from Bit Twiddling Hacks.
In reply to Re^3: reliable get position of leftmost bit in large integers
by BrowserUk
in thread reliable get position of leftmost bit in large integers
by wollmers
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |