Commit | Line | Data |
---|---|---|
1c05e080 KB |
1 | .\" Copyright (c) 1990 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" This code is derived from software contributed to Berkeley by | |
5 | .\" Chris Torek. | |
6 | .\" | |
7 | .\" %sccs.include.redist.man% | |
8 | .\" | |
9 | .\" @(#)ffs.3 5.1 (Berkeley) %G% | |
10 | .\" | |
11 | .TH FFS 3 "" | |
12 | .UC 7 | |
13 | .SH NAME | |
14 | ffs \- find first bit set in a bit string | |
15 | .SH SYNOPSIS | |
16 | .nf | |
17 | .ft B | |
18 | #include <string.h> | |
19 | ||
20 | int | |
21 | ffs(int value); | |
22 | .ft R | |
23 | .fi | |
24 | .SH DESCRIPTION | |
25 | .B Ffs | |
26 | finds the first bit set in | |
27 | .I value | |
28 | and returns the index of that bit. | |
29 | Bits are numbered starting from 1, starting at the right-most | |
30 | bit. | |
31 | A return value of 0 means that the argument was zero. | |
32 | .SH SEE\ ALSO | |
33 | bitstring(3) |