TCardinalHelper.HighestSetBitPos¶
Return the position of the leftmost bit set.
Declaration¶
Source position: syshelph.inc line 1126
public
function TCardinalHelper.HighestSetBitPos : Int8;
Description¶
HighestSetBitPos scans the Cardinal, 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¶
| Name | Description |
|---|---|
| System.BsrByte | Return the position of the leftmost set bit in an 8-bit value. |
| TCardinalHelper.SetBit | Set bit to 1. |
| TCardinalHelper.ClearBit | Set bit to 0. |
| TCardinalHelper.ToggleBit | Invert bit. |
| TCardinalHelper.TestBit | Check bit. |
| TCardinalHelper.LowestSetBitPos | Return the position of the rightmost bit set. |
| TCardinalHelper.SetBitsCount | Count number of bits set. |
| TCardinalHelper.Bits | Read or write a bit. |