IntegerBitsΒΆ

random.spad line 109 [edit on github]

This package provides functions to lookup bits in integers.

bitCoef: (Integer, NonNegativeInteger) -> Integer

bitCoef(n, m) returns the coefficient of 2^m in two complement representation of n.

bitTruth: (Integer, NonNegativeInteger) -> Boolean

bitTruth(n, m) returns true if coefficient of 2^m in two complement representation of n is 1.