blob: b27c74fafdc53c2db15825f9659ad0f6ace65fdc [file]
<html lang="en">
<head>
<title>ffs - Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Misc.html#Misc" title="Misc">
<link rel="next" href="unctrl.html#unctrl" title="unctrl">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="ffs"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="unctrl.html#unctrl">unctrl</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Misc.html#Misc">Misc</a>
<hr>
</div>
<h3 class="section">11.1 <code>ffs</code>&mdash;find first bit set in a word</h3>
<p><a name="index-ffs-458"></a><strong>Synopsis</strong>
<pre class="example"> #include &lt;strings.h&gt;
int ffs(int <var>word</var>);
</pre>
<p><strong>Description</strong><br>
<p><code>ffs</code> returns the first bit set in a word.
<p><br>
<strong>Returns</strong><br>
<code>ffs</code> returns 0 if <var>c</var> is 0, 1 if <var>c</var> is odd, 2 if <var>c</var> is a multiple of
2, etc.
<p><br>
<strong>Portability</strong><br>
<code>ffs</code> is not ANSI C.
<p>No supporting OS subroutines are required.
<br>
</body></html>