Many CPUs have ways of counting leading zeroes. In gcc, these can be access using __builtin_clz, __builtin_clzl and __builtin_clzll.
So you could use Inline::C to run C code that uses that.
Or you could use XS or FFI::Platypus to access a C library that provides a function that uses that.
In reply to Re: Most Significant Set Bit
by ikegami
in thread Most Significant Set Bit
by coldr3ality
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |