Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Ocaml_intrinsics.Int
SourceThe are two version of count_leading_zeros
, count_set_bits
each, which differ in their native code implementation. The first version takes as input a tagged integer and the second version takes as input an untagged integer. Generally, the first version (that operates on a tagged integer) is faster, but if the integer is already untagged, it may be faster to use the second version.
count_leading_zeros n
returns the number of most-significant zero bits before the most significant set bit in n
. If n
is 0, the result is the number of bits in n
, that is 31 or 63, depending on the target.
count_set_bits n
returns the number of bits that are 1 in n
.
count_trailing_zeros n
returns the number of least-significant zero bits before the least significant set bit in n
. If n
is 0, the result is the number of bits in n
, that is 31 or 63, depending on the target.