Arbitrary precision integers library.
This library mainly features the Arbitrary precision Integer (
which is an
n-bit integer type acting like a machine integer working in the twos-complement.
This is useful for emulating machine integers for example in constant evaluation of compilers or for solving bitvector formulas of SMT solvers.
ApInt uses small-value optimization for values with a bit-width less than or
64 bits. It uses
64 bit digits and thus its algorithms computes within the base
ApInt data structure does not know signedness. Instead, the operations defined on it
(methods) do so. This makes it the perfect building block for higher-level primitives later on.
The crate was designed for correctness of emulation and performance in mind and the interface
ApInt is very comprehensive.
Re-exports some commonly used items of this crate.
An arbitrary precision integer with modulo arithmetics similar to machine integers.
Represents a bit position within an
Represents an error that may occure upon using the
Signed machine integer with arbitrary bitwidths and modulo arithmetics.
A radix for parsing strings as
Represents an amount of bits to shift an
Unsigned machine integer with arbitrary bitwidths and modulo arithmetics.
Represents the set or unset state of a bit within an
Represents the kind of an
Types that have an associated bit width may implement