We provide a couple of additional bitwise operations. The
evaluable functions bitcount/1, bitlength/1 and lowestsetbit/1
deal with the determination of certain bits of the given integer.
bitlength(333) --> 9
The evaluable functions setbit/2 and clearbit/2 update the given integer in a more efficient way than would be possible with existing logical and shift operations. The predicate testbit/2 tests a particular bit in a given integer, again the implementation is more efficient than would be possible with existing logical, shift and test operations.
The following bitwise evaluable functions are provided:
The following built-in predicates are provided for bitwise
extensions. The built-ins arithmetically evaluate their arguments
before performing their tests: