Contributors: @arvidn, @cuviper, @guidovranken
Contributors: @catenacyber, @cuviper
Contributors: @cuviper, @PatrickNorton
arbitrarysupport has been updated to 1.0, requiring Rust 1.40.
quickchecksupport has been updated to 1.0, requiring Rust 1.46.
randsupport has been updated to 0.8, requiring Rust 1.36.
Debugnow shows plain numeric values for
BigUint, rather than the raw list of internal digits.
Contributors: @cuviper, @Gelbpunkt
Contributors: @catenacyber, @cuviper
trailing_onesreturn the number of
1bits in the entire value or just its least-significant tail, respectively.
set_bitwill read and write individual bits of the value. For negative
BigInt, bits are determined as if they were in the two's complement representation.
from_radix_bemethods now accept empty buffers to represent zero.
BigUintcan now iterate digits as
u64, regardless of the actual internal digit size.
Contributors: @BartMassey, @cuviper, @janmarthedal, @sebastianv89, @Speedy37
x86_64when built with Rust 1.33 or later.
to_f64now return infinity for very large numbers, rather than
None. This does preserve the sign too, so a large negative
BigIntwill convert to negative infinity.
arbitrary::Arbitrary, distinct from
BigUintwill opportunistically shrink capacity if the internal vector is much larger than needed.
Contributors: @cuviper, @e00E, @ejmahler, @notoria, @tczajka
BigDigitmay now be either
u64, although that implementation detail is not exposed in the API. For now, this is chosen to match the target pointer size, but may change in the future.
stdis now supported with the
alloccrate on Rust 1.36.
Powis now implemented for bigint values, not just references.
TryFromis now implemented on Rust 1.34 and later, converting signed integers to unsigned, and narrowing big integers to primitives.
Shrare now implemented for a variety of shift types.
trailing_zeros()returns the number of consecutive zeros from the least significant bit.
into_partsmethods give access to its
BigUintpart as the magnitude.
num-bigintnow requires Rust 1.31 or greater.
randsupport has been updated to 0.7, requiring Rust 1.32.
quickchecksupport has been updated to 0.9, requiring Rust 1.34.
impl Neg for BigUint, which only ever panicked.
Contributors: @cuviper, @dignifiedquire, @hansihe, @kpcyrd, @milesand, @tech6hutch
Contributors: @cuviper, @HactarCE
Contributors: @cuviper, @tspiteri
BigUint::to_u32_digitsmethod returns the number as a little-endian vector of base-232 digits. The same method on
BigIntalso returns the sign.
BigUint::modpownow applies a modulus even for exponent 1, which also affects
BigInt::modpownow returns the correct sign for negative bases with even exponents.
Contributors: @alex-ozdemir, @cuviper, @dingelish, @Speedy37, @youknowone
Powis now implemented for
quickcheckfeature enables implementations of
Contributors: @cuviper, @lcnr, @maxbla, @mikelodder7, @mikong, @TheLetterTheta, @tspiteri, @XAMPPRocky, @youknowone
Rootsimplementations now use better initial guesses.
to_signed_bytes_*for some positive numbers, where the most-significant byte is
0x80and the rest are
Contributors: @cuviper, @leodasvacas
Rng::fill_bytesto improve performance, instead of repeated
gen::<u32>calls. The also affects the implementations of the other
randtraits. This may potentially change the values produced by some seeded RNGs on previous versions, but the values were tested to be stable with
BigUintnow implement operators with 128-bit integers.
Contributors: @cuviper, @dignifiedquire, @mancabizjak, @Robbepop, @TheIronBorn, @thomwiggers
Sumfor iterators of any item that we can
Add, respectively. For example, a factorial can now be simply:
let f: BigUint = (1u32..1000).product();
BigIntnow supports two's-complement logic operations, namely
Not. These act conceptually as if each number had an infinite prefix of
1bits for positive or negative.
BigIntnow supports assignment operators like
BigUintnow support conversions with
u128, if sufficient compiler support is detected.
BigUintnow implement rand's
SampleUniformtrait, and a custom
RandomBitsdistribution samples by bit size.
num-bigintnow requires rustc 1.15 or greater.
stdfeature, and won't build without it. This is in preparation for someday supporting
serdedependency has been updated to 1.0, still disabled by default. The
rustc-serializecrate is no longer supported by
randdependency has been updated to 0.5, now disabled by default. This requires rustc 1.22 or greater for
rand's own requirement.
Shr for BigIntnow rounds down rather than toward zero, matching the behavior of the primitive integers for negative values.
ParseBigIntErroris now an opaque type.
big_digitmodule is no longer public, nor are the
ZERO_BIG_DIGITconstant that were re-exported in the crate root. Public APIs which deal in digits, like
BigUint::from_slice, will now always be base-
Contributors: @clarcharr, @cuviper, @dodomorandi, @tiehuis, @tspiteri
Contributors: @cuviper, @Robbepop
BigInt::modpowperforms signed modular exponentiation, using the existing
BigUint::modpowand rounding negatives similar to
lcmnow avoids creating a large intermediate product.
gcdnow uses Stein's algorithm with faster shifts instead of division.
randsupport is now extended to 0.4 (while still allowing 0.3).
Contributors: @cuviper, @Emerentius, @ignatenkobrain, @mhogrefe
No prior release notes were kept. Thanks all the same to the many contributors that have made this crate what it is!