DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

ffs(S-osr5)


ffs -- find first set bit

Syntax

cc ...-lc

#include <strings.h>

int ffs(int i);

Description

ffs(S-osr5) 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-osr5) is conformant with:

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


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005