The
ffs32() and
ffs64() functions find the first bit set in
n and return the index of that bit. Conversely, the
fls32() and
fls64() functions find the last bit set in
n, returning the index of the bit.
The search always starts from the bit 1 (the least significant bit). If the argument
n is zero, each function returns zero.