Sign in Join
FPDoc Onlineexperiment

TIntegerHelper.HighestSetBitPos function

Member of TIntegerHelperpublicIn unit sysutils

Return the position of the leftmost bit set.

Declaration

pascal
function HighestSetBitPos: Int8

Description

HighestSetBitPos scans the Integer, starting at the leftmost position and working towards position 0, and returns the index of the first set bit. The position is measured from the 0-th, rightmost bit. When there are no bits set, the result is -1.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.