Crate apint [−] [src]
Arbitrary precision integers library.
This library mainly features the Arbitrary precision Integer (ApInt
) type
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.
Internally ApInt
uses small-value optimization for values with a bit-width less than or
equal to 64
bits. It uses 64
bit digits and thus its algorithms computes within the base
of 264.
The 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
of ApInt
is very comprehensive.
Structs
ApInt |
An arbitrary precision integer with modulo arithmetics similar to machine integers. |
BitPos |
Represents a bit position within an |
BitWidth |
The |
Error |
Represents an error that may occure upon using the |
Radix |
A radix for parsing strings as |
ShiftAmount |
Represents an amount of bits to shift an |
Enums
Bit |
Represents the set or unset state of a bit within an |
ErrorKind |
Represents the kind of an |
Traits
Width |
Types that have an associated bit width may implement |
Type Definitions
Result |
The |