Expand description
This crate defines a custom medium-precision number type. It can support any base b
in the range [0, 65535]
, and can approximately represent numbers up to
b ^ u64::MAX
(actually a bit higher than that but the math is complicated). A core
goal for this type was that it can implement Copy
and as a result it can be used in
almost any context a normal unsigned integer would be valid.
Modules§
- This module contains additional traits I thought may be useful for BigNum usage.
Macros§
- This macro creates a default
Base
implementation with a given name and number.
Structs§
- This is the main struct for
bignumbe-rs
. - This type represents a binary base. It contains more efficient overrides of the
Base
functions to improve performance. - This type represents a decimal base. It contains more efficient overrides of the
Base
functions to improve performance. - This represents the non-inclusive range of exponents that constitute a valid non-compact significand in the given base. You only need to use this if manually defining a custom base (if performance is non-critical I would recommend using the
create_default_base
macro). - This type represents a hexadecimal base. It contains more efficient overrides of the
Base
functions to improve performance. - This type represents an octal base. It contains more efficient overrides of the
Base
functions to improve performance. - This represents the inclusive range of values that constitute a valid non-compact significand in the given base. You only need to use this if manually defining a custom base (if performance is non-critical I would recommend using the
create_default_base
macro).
Traits§
- If performance isn’t critical I’d highly recommend the
create_default_base
macro which creates a base with sensible defaults. The only reason to create a custom implementation is if you find the default implementations’ operations to be a bottleneck. In this case I’d recommend looking at my implementation of theDecimal
base as a guide.