Help for this page

Select Code to Download


  1. or download this
    sub most_significant_ix {
        my $n = shift;
        return if $_[0] == 0;
        return int(log($_[0])/log(2));
    }
    
  2. or download this
    sub most_significant_ix {
        my $n = shift;
    ...
            return $bits if (2**$bits) & $n;
        }
    }