Implementation status: to be implemented

Synopsis

#include <strings.h>

int ffs(int i);

Description

The ffs() function finds the first bit set (beginning with the least significant bit) in i, and returns the index of that bit. Bits are numbered starting at one (the least significant bit).

Arguments:

i - a number to be checked.

Return value

The index of the first bit set in i.

Errors

No errors are defined.

Implementation tasks

  • Implement the ffs() function.