gnu.math
public class BitOps extends Object
Method Summary | |
---|---|
static IntNum | and(IntNum x, int y) Return the logical (bit-wise) "and" of an IntNum and an int. |
static IntNum | and(IntNum x, IntNum y) Return the logical (bit-wise) "and" of two IntNums. |
static int | bitCount(int i) |
static int | bitCount(int[] x, int len) |
static int | bitCount(IntNum x) Count one bits in an IntNum.
|
static IntNum | bitOp(int op, IntNum x, IntNum y) Do one the the 16 possible bit-wise operations of two IntNums. |
static boolean | bitValue(IntNum x, int bitno) Return the value of a specified bit in an IntNum. |
static IntNum | extract(IntNum x, int startBit, int endBit) Extract a bit-field as an unsigned integer. |
static IntNum | ior(IntNum x, IntNum y) Return the logical (bit-wise) "(inclusive) or" of two IntNums. |
static IntNum | not(IntNum x) Return the logical (bit-wise) negation of an IntNum. |
static void | setBitOp(IntNum result, int op, IntNum x, IntNum y) Do one the the 16 possible bit-wise operations of two IntNums. |
static int | swappedOp(int op) Return the boolean opcode (for bitOp) for swapped operands.
|
static boolean | test(IntNum x, int y) Return true iff an IntNum and an int have any true bits in common. |
static boolean | test(IntNum x, IntNum y) Return true iff two IntNums have any true bits in common. |
static IntNum | xor(IntNum x, IntNum y) Return the logical (bit-wise) "exclusive or" of two IntNums. |