Previous: Modification of Bit Strings, Up: Bit Strings

— procedure: **unsigned-integer->bit-string**` length integer`

Both

lengthandintegermust be exact non-negative integers. Convertsintegerinto a newly allocated bit string oflengthbits. Signals an error of type`condition-type:bad-range-argument`

ifintegeris too large to be represented inlengthbits.

— procedure: **signed-integer->bit-string**` length integer`

Lengthmust be an exact non-negative integer, andintegermay be any exact integer. Convertsintegerinto a newly allocated bit string oflengthbits, using two's complement encoding for negative numbers. Signals an error of type`condition-type:bad-range-argument`

ifintegeris too large to be represented inlengthbits.

— procedure: **bit-string->unsigned-integer**` bit-string`

— procedure:**bit-string->signed-integer**` bit-string`

— procedure:

Converts

bit-stringinto an exact integer.`bit-string->signed-integer`

regardsbit-stringas a two's complement representation of a signed integer, and produces an integer of like sign and absolute value.`bit-string->unsigned-integer`

regardsbit-stringas an unsigned quantity and converts to an integer accordingly.