ffs()

find first set bit 

Function


SYNOPSIS

#include <string.h>

int ffs(unsigned int i);


DESCRIPTION

The ffs() function returns the index of the first bit set in i. Bits are numbered starting at 1 from the least significant bit. A return value of zero indicates the value of i is zero.


PARAMETERS

i 

Is an integer.


RETURN VALUES

The ffs() returns the index of the first bit set in i, or zero if no bits are set.


CONFORMANCE

4.4BSD


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
bcmp(), bcopy(), bzero()


PTC MKS Toolkit 10.4 Documentation Build 39.