www.delorie.com/djgpp/doc/libc/libc_316.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

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.

Portability

ANSI/ISO C No
POSIX No

Example

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


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2004   by DJ Delorie     Updated Apr 2004