Canonical binary arithmetic #
The parameter algorithms use binary integers, even when their values are much larger than the available work space. These programs manipulate binary digits directly. In particular, converting a bit string to a natural number normalizes its encoding without expanding its value to unary.
Prepend a digit, suppressing the noncanonical representation of zero.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Read and normalize an arbitrary little-endian bit string.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Binary borrow, used on the nonzero canonical representation.
Equations
Instances For
The existing borrow machine, with its missing zero case supplied. Its
output need not be canonical; bitsValue subsequently normalizes it.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Saturating predecessor of a binary integer.
Equations
Instances For
Add a unary offset to a binary integer.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Subtract a unary offset from a binary integer, saturating at zero. The intermediate values are bounded by the initial integer, in binary size.
Equations
- One or more equations did not get rendered due to their size.