GNU/Linux |
RedHat 9.0(Shrike) |
|
![]() |
ffs(3) |
![]() |
ffs − find first bit set in a word
#include <strings.h>
int ffs(int i);
The ffs() function returns the position of the first bit set in the word i. The least significant bit is position 1 and the most significant position e.g. 32 or 64.
The ffs() function returns the position of the first bit set, or 0 if no bits are set.
BSD 4.3, POSIX 1003.1-2001.
BSD systems have a prototype in <string.h>.
![]() |
ffs(3) | ![]() |