- or download this
$m is assigned the most significant set bit of 64-bit integer $z, for
+the cost of 6 ANDs and 6 truth tests.
...
4: 2
: 2 ;
- or download this
my $z=17;
my $m;
...
0xFFFFFFFFFFFFFFFC&$z? 61: 62
: 0xFFFFFFFFFFFFFFFF&$z? 63: 64;
}
- or download this
my $m=0xFFFF8000&$z?
0xFF800000&$z?
...
: 0xFFFFFFFE&$z?
0xFFFFFFFC&$z? 29: 30
: 0xFFFFFFFF&$z? 31: 32;