DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

ffs(S)


ffs -- find first set bit

Syntax

cc ...-lc

#include <strings.h>

int ffs(int i);

Description

ffs(S) finds the first bit set in the argument passed to it and returns the index of that bit. Bits are numbered starting at 1 from the least significant bit.

Return values

A return value of zero indicates that the value passed is zero. Otherwise, it returns the index of the first bit set.

Diagnostics

This function does not set errno.

See also

Standards conformance

ffs(S) is conformant with:

X/Open CAE Specification, System Interfaces and Headers, Issue 4, Version 2.


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003