1<html lang="en"> 2<head> 3<title>ffs - Untitled</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="Untitled"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="Misc.html#Misc" title="Misc"> 9<link rel="next" href="unctrl.html#unctrl" title="unctrl"> 10<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 11<meta http-equiv="Content-Style-Type" content="text/css"> 12<style type="text/css"><!-- 13 pre.display { font-family:inherit } 14 pre.format { font-family:inherit } 15 pre.smalldisplay { font-family:inherit; font-size:smaller } 16 pre.smallformat { font-family:inherit; font-size:smaller } 17 pre.smallexample { font-size:smaller } 18 pre.smalllisp { font-size:smaller } 19 span.sc { font-variant:small-caps } 20 span.roman { font-family:serif; font-weight:normal; } 21 span.sansserif { font-family:sans-serif; font-weight:normal; } 22--></style> 23<link rel="stylesheet" type="text/css" href="../cs.css"> 24</head> 25<body> 26<div class="node"> 27<a name="ffs"></a> 28<p> 29Next: <a rel="next" accesskey="n" href="unctrl.html#unctrl">unctrl</a>, 30Up: <a rel="up" accesskey="u" href="Misc.html#Misc">Misc</a> 31<hr> 32</div> 33 34<h3 class="section">11.1 <code>ffs</code>—find first bit set in a word</h3> 35 36<p><a name="index-ffs-458"></a><strong>Synopsis</strong> 37<pre class="example"> #include <strings.h> 38 int ffs(int <var>word</var>); 39 40</pre> 41 <p><strong>Description</strong><br> 42 43 <p><code>ffs</code> returns the first bit set in a word. 44 45 <p><br> 46<strong>Returns</strong><br> 47<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 482, etc. 49 50 <p><br> 51<strong>Portability</strong><br> 52<code>ffs</code> is not ANSI C. 53 54 <p>No supporting OS subroutines are required. 55<br> 56 57 </body></html> 58 59