lsb
ErrorsCollection

lsb

Synthesised documentation from type/Int

From type/Int

See Original text in context

multi method lsb(Int:D:)
multi sub    lsb(Int:D)

Short for "Least Significant Bit". Returns Nil if the number is 0. Otherwise returns the zero-based index from the right of the least significant (rightmost) 1 in the binary representation of the number.

say 0b01011.lsb;        # OUTPUT: «0␤» 
say 0b01010.lsb;        # OUTPUT: «1␤» 
say 0b10100.lsb;        # OUTPUT: «2␤» 
say 0b01000.lsb;        # OUTPUT: «3␤» 
say 0b10000.lsb;        # OUTPUT: «4␤»