Frenetic_kernel.BitsSourceBit manipulation for integers
Though Std has bitwise and's, or's and shifting, Frenetic needs some more bit-specific primitives. Other libraries like bitv have them, but they require converting back and forth to abstract data types ... this approach is faster and less complex.
clear_bit n x sets bit n in integer x to 0
set_bit n x sets bit n in integer x to 1
bit x n set_bit sets bit n of integer x to 1 if set_bit=true, 0 otherwise.
test_bit n x returns true if bit n in integer x is 1
get_byte32 x n returns the n'th byte of int32 x. The least significant byte is 0, the most is 3. Raises error if n is not in 0..3
get_byte x n returns the n'th byte of int64 x. The least significant byte is 0, the most is 7. Raises error if n is not in 0..7