in reply to Most Significant Set Bit
I hope I have beaten syphilis to publishing GCC::Builtins
use GCC::Builtins qw/clz/; # or qw/:all/; $msb1 = clz(10); # 28
Disclaimer: Builtins are implemented by GCC, I am merely interfacing them to Perl with XS, mechanistically. All questions to GCC please.
bw, bliako
|
---|