FFS(3C) Standard C Library Functions FFS(3C) NNAAMMEE ffs - find first set bit SSYYNNOOPPSSIISS #include iinntt ffffss(iinntt _i); iinntt ffffssll(ong _i); iinntt ffffssllll(lloonngg lloonngg _i); iinntt ffllss(iinntt _i); iinntt ffllssll(lloonngg _i); iinntt ffllssllll(lloonngg lloonngg _i); DDEESSCCRRIIPPTTIIOONN The ffffss(()), ffffssll(()),, aanndd ffffssllll(()) functions finds the first bit set (beginning with the least significant bit) and return the index of that bit. Bits are numbered starting at one (the least significant bit). The ffllss(()), ffllssll(()), and ffllssllll(()) functions find the last bit set (beginning with the least significant bit) and return the index of that bit. Bits are numbered starting at one (the least significant bit). RREETTUURRNN VVAALLUUEESS The ffffss(()), ffffssll(()), and ffffssllll(()) functions returns the index of the first bit set. If _i is 0, then they return 0. The ffllss(()), ffllssll(()), and ffllssllll(()) functions return the index of the last bit set. If _i is 0, then they return 0. EERRRROORRSS No errors are defined. AATTTTRRIIBBUUTTEESS See aattttrriibbuutteess(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Interface Stability | Committed | +--------------------+-----------------+ |MT-Level | MT-Safe | +--------------------+-----------------+ SSEEEE AALLSSOO aattttrriibbuutteess(5), ssttaannddaarrddss(5) May 21, 2015 FFS(3C)