www.delorie.com/djgpp/doc/libc-2.01/libc_263.html   search  
Go to the first, previous, next, last section, table of contents.


ffs

Syntax

#include <string.h>

int ffs(int _mask);

Description

This function find the first (least significant) bit set in the input value.

Return Value

Bit position (1..32) of the least significant set bit, or zero if the input value is zero.

Example

ffs(0) = 0
ffs(1) = 1
ffs(5) = 1
ffs(96) = 6


Go to the first, previous, next, last section, table of contents.

  prev next   webmaster     delorie software   privacy  
  Copyright © 1997     Updated Apr 1997