JCL Help:BitsLowest@Byte

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Returns the lowest bit set in the supplied value.


Pascal

 function BitsLowest(X: Byte): Integer; overload;
function BitsLowest(X: Shortint): Integer; overload;
function BitsLowest(X: Smallint): Integer; overload;
function BitsLowest(X: Word): Integer; overload;
function BitsLowest(X: Cardinal): Integer; overload;
function BitsLowest(X: Integer): Integer; overload;
function BitsLowest(X: Int64): Integer; overload;


Parameters

Parameters Description
X: Byte The value for which to return the lowest set bit.


Return Value

The index of the lowest bit set, or -1 if no bits are set.


Description

BitsLowest returns the index of the lowest bit which is set in the supplied value. Note that bits are numbered right to left starting with 0. For example, BitsLowest(9) returns 2 (9 is 00001100 in binary).


See Also

BitsHighest CountBitsSet


About

Unit

JclLogic


Donator

Michael Schnell


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page