IntegerBitsΒΆ

random.spad line 109

This package provides functions to lookup bits in integers

bitCoef: (Integer, Integer) -> Integer
bitCoef(n, m) returns the coefficient of 2^m in abs(n)
bitLength: Integer -> Integer
bitLength(n) returns the number of bits to represent abs(n)
bitTruth: (Integer, Integer) -> Boolean
bitTruth(n, m) returns true if coefficient of 2^m in abs(n) is 1