'\" t .\" Title: fls .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: June 2017 .\" Manual: Basic C Library Functions .\" Source: Kernel Hackers Manual 4.11.3 .\" Language: English .\" .TH "FLS" "9" "June 2017" "Kernel Hackers Manual 4\&.11\&" "Basic C Library Functions" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" fls \- find last set bit in word .SH "SYNOPSIS" .HP \w'int\ fls('u .BI "int fls(int\ " "x" ");" .SH "ARGUMENTS" .PP \fIint x\fR .RS 4 the word to search .RE .SH "DESCRIPTION" .PP This is defined in a similar way as the libc and compiler builtin ffs, but returns the position of the most significant set bit\&. .PP fls(value) returns 0 if value is 0 or the position of the last set bit if value is nonzero\&. The last (most significant) bit is at position 32\&. .SH "COPYRIGHT" .br