hw-bits-0.7.2.1: Bit manipulation
HaskellWorks.Data.Bits.Word64
lsb :: Word64 -> Word64 Source #
Returns the position of the least significant bit (0-based).
This is equivalent to countTrailingZeros except for when there are no bits set. In which case return a word with all bits set.
countTrailingZeros
>>> lsb 8 3 >>> lsb 1 0 >>> lsb 0 18446744073709551615
>>>
lsb 8
lsb 1
lsb 0