/usr/share/axiom-20170501/src/algebra/INTBIT.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | )abbrev package INTBIT IntegerBits
++ Description:
++ This package provides functions to lookup bits in integers
IntegerBits() : SIG == CODE where
SIG ==> with
-- bitLength(n) == # of bits to represent abs(n)
-- bitCoef (n,i) == coef of 2**i in abs(n)
-- bitTruth(n,i) == true if coef of 2**i in abs(n) is 1
bitLength : Integer -> Integer
++ bitLength(n) returns the number of bits to represent abs(n)
bitCoef : (Integer, Integer) -> Integer
++ bitCoef(n,m) returns the coefficient of 2**m in abs(n)
bitTruth : (Integer, Integer) -> Boolean
++ bitTruth(n,m) returns true if coefficient of 2**m in abs(n) is 1
CODE ==> add
bitLength n == INTEGER_-LENGTH(n)$Lisp
bitCoef (n,i) == if INTEGER_-BIT(n,i)$Lisp then 1 else 0
bitTruth(n,i) == INTEGER_-BIT(n,i)$Lisp
|