Amiga Unix — 68040 · 68060

Manual pages › C library (3C)

ffs(3C)

find first set bit

From the original Amiga UNIX 2.1 manual. Some things it mentions may not be in this release.

NAME

ffs - find first set bit

SYNOPSIS

#include <string.h>

int ffs(const int i);

DESCRIPTION

ffs finds the first bit set in the argument passed it and returns the index of that bit. Bits are numbered starting at 1 from the low order bit. A return value of zero indicates that the value passed is zero.