Scheme 48 Manual | Contents | In Chapter: Libraries
Previous: ASCII character encoding | Next: Byte vectors

Bitwise integer operations

These functions use the two's-complement representation for integers. There is no limit to the number of bits in an integer. They are in the structures bitwise and big-scheme.

These perform various logical operations on integers on a bit-by-bit basis. `ior' is inclusive OR and `xor' is exclusive OR. Shifts the integer by the given bit count, which must be an integer, shifting left for positive counts and right for negative ones. Shifting preserves the integer's sign. Counts the number of bits set in the integer. If the argument is negative a bitwise NOT operation is performed before counting.

Previous: ASCII character encoding | Next: Byte vectors