Différences entre les versions de « Les opérations bit à bit/Manipulations sur les bits de poids faible/fort »

m
unsigned countLeadingZeros (unsigned n)
{
na |= SetBitsAfterHighestOne(n >> 1;)
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16 ;
 
return WORDBITS - population_count( n a) ;
}
</syntaxhighlight>
unsigned countLeadingZeros (unsigned n)
{
na |= SetBitsAfterHighestOne(n >> 1;)
n |= n >> 2;
n |= n >> 4;
n |= n >> 8;
n |= n >> 16;
 
return population_count( ~ na ) ;
}
</syntaxhighlight>
38 132

modifications