msb64(3)
limb manual
msb64(3)
NAME
msb64 - return the position of the most significant bit set
SYNOPSIS
#include <limb/uint64.h>
int msb64(u64 val)
DESCRIPTION
The msb64
() function returns the position of the last (most significant) bit
set in val
.
The least significant bit is position 1 and the most significant bit is position 64.
RETURN VALUE
msb64
() returns the position of the most significant bit set (from 1 to 64),
or 0 if no bits are set (i.e. val
is zero).