This project adheres to Semantic Versioning.
- Modular arithmetic moved from
modular
to the top-level module.
- Minimum Rust version is now 1.61.
rand
is no longer a default dependency.num-traits
is no longer optional.
- GCD, greatest common divisor.
- Extended GCD (GCD with Bézout coefficients).
- Modular inverse.
- Modular division.
- Corrected too-strict lifetimes in modular exponentiation.
- Removed the dependency on
const_fn_assert
.
- Optional
serde
support forUBig
andIBig
.
- Rust 1.49+ is now required.
- Added an optional dependency on
serde
.
-
Mixed-type arithmetic with primitive integer types.
Allows
x + 1
instead ofx + ubig!(1)
.This breaks with the convention that arithmetic operators require same type on both sides. A better alternative would be user-defined custom integer literals, so that
1
could be inferred to have typeUBig
. But Rust does not support this yet. So this is a workaround for the sake of ergonomics.
- Rust 1.47+ is now supported.
- Added a dependency on
cfg-if
.
- Maximum supported length in bits:
UBig::MAX_BIT_LEN
.
- Broken build for
aarch64
,mips64
andpowerpc64
fixed.
- Added a dependency on
const_fn_assert
.
- Removed
prelude
. - Split into modules:
- Moved
InRadix
tofmt
. - Moved operator traits to
ops
. - Moved errors to
error
. - Moved distributions to
rand
.
- Moved
- Removed deprecated
IBig::is_positive
,IBig::is_negative
. Just compare withibig!(0)
instead. - Shift left and right now only accepts
usize
for the number of bits, for consistency with other bit addressing operations and exponents.
- Modular arithmetic:
ModuloRing
,Modulo
. - Conversions to floating point:
to_f32
,to_f64
. Rounds to nearest, breaking ties to even. From<bool>
forIBig
.
- Loosened the license to either MIT or Apache-2.0.
- Implemented num-traits traits.
IBig::is_positive
,IBig::is_negative
. Just use> ibig!(0)
,< ibig!(0)
.
- Added optional dependency on
num-traits 0.2.14
. - Removed dependency on
ascii
.
- Removed deprecated functions
to_str_radix
,to_str_radix_uppercase
,ilog2
.
bit_len
to_str_radix
,to_str_radix_uppercase
. Usein_radix(...)
instead.ilog2
. Usebit_len
instead.
- Added a dependency on
static_assertions 1.1
. - Bumped
rand
to0.8.3
.
- Large division improved. Now uses a divide and conquer algorithm, O(n^1.47).
- Large
parse
improved using a divide and conquer algorithm, O(n^1.47). - Large
to_string
improved using a divide and conquer algorithm, O(n^1.47). - Other minor performance improvements.
- Hashing.
- Exponentiation.
- Random sampling (optional dependency on
rand 0.8
).
- Multiplication improved, now uses Karatsuba and Toom-Cook-3 algorithms, O(n^1.47).
factorial
prints 1000000! in hexadecimal.
The initial usable version.
- All basic arithmetic and bitwise operations.
- Parsing and formatting.
- Constructor macros.
- Operations on very large numbers are still slow.