hw-bits-0.7.2.1: Bit manipulation

Safe HaskellNone
LanguageHaskell2010

HaskellWorks.Data.Bits.Word64

Synopsis

Documentation

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.

>>> lsb 8
3
>>> lsb 1
0
>>> lsb 0
18446744073709551615