12 KiB
Release 0.4.3 (2021-11-02)
Contributors: @arvidn, @cuviper, @guidovranken
Release 0.4.2 (2021-09-03)
Contributors: @catenacyber, @cuviper
Release 0.4.1 (2021-08-27)
- Fixed scalar divide-by-zero panics.
- Implemented
DoubleEndedIteratorforU32DigitsandU64Digits. - Optimized multiplication to avoid unnecessary allocations.
- Optimized string formatting for very large values.
Contributors: @cuviper, @PatrickNorton
Release 0.4.0 (2021-03-05)
Breaking Changes
- Updated public dependences on arbitrary, quickcheck, and rand:
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 forBigIntandBigUint, rather than the raw list of internal digits.
Contributors: @cuviper, @Gelbpunkt
Release 0.3.3 (2021-09-03)
Contributors: @catenacyber, @cuviper
Release 0.3.2 (2021-03-04)
- The new
BigUintmethodscount_onesandtrailing_onesreturn the number of1bits in the entire value or just its least-significant tail, respectively. - The new
BigIntandBigUintmethodsbitandset_bitwill read and write individual bits of the value. For negativeBigInt, bits are determined as if they were in the two's complement representation. - The
from_radix_leandfrom_radix_bemethods now accept empty buffers to represent zero. BigIntandBigUintcan now iterate digits asu32oru64, regardless of the actual internal digit size.
Contributors: @BartMassey, @cuviper, @janmarthedal, @sebastianv89, @Speedy37
Release 0.3.1 (2020-11-03)
- Addition and subtraction now uses intrinsics for performance on
x86andx86_64when built with Rust 1.33 or later. - Conversions
to_f32andto_f64now return infinity for very large numbers, rather thanNone. This does preserve the sign too, so a large negativeBigIntwill convert to negative infinity. - The optional
arbitraryfeature implementsarbitrary::Arbitrary, distinct fromquickcheck::Arbitrary. - The division algorithm has been optimized to reduce the number of temporary allocations and improve the internal guesses at each step.
BigIntandBigUintwill opportunistically shrink capacity if the internal vector is much larger than needed.
Contributors: @cuviper, @e00E, @ejmahler, @notoria, @tczajka
Release 0.3.0 (2020-06-12)
Enhancements
- The internal
BigDigitmay now be eitheru32oru64, 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. - No-
stdis now supported with thealloccrate 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.ShlandShrare now implemented for a variety of shift types.- A new
trailing_zeros()returns the number of consecutive zeros from the least significant bit. - The new
BigInt::magnitudeandinto_partsmethods give access to itsBigUintpart as the magnitude.
Breaking Changes
num-bigintnow requires Rust 1.31 or greater.- The "i128" opt-in feature was removed, now always available.
- Updated public dependences:
randsupport has been updated to 0.7, requiring Rust 1.32.quickchecksupport has been updated to 0.9, requiring Rust 1.34.
- Removed
impl Neg for BigUint, which only ever panicked. - Bit counts are now
u64instead ofusize.
Contributors: @cuviper, @dignifiedquire, @hansihe, @kpcyrd, @milesand, @tech6hutch
Release 0.2.6 (2020-01-27)
Contributors: @cuviper, @HactarCE
Release 0.2.5 (2020-01-09)
Contributors: @cuviper, @tspiteri
Release 0.2.4 (2020-01-01)
- The new
BigUint::to_u32_digitsmethod returns the number as a little-endian vector of base-232 digits. The same method onBigIntalso returns the sign. BigUint::modpownow applies a modulus even for exponent 1, which also affectsBigInt::modpow.BigInt::modpownow returns the correct sign for negative bases with even exponents.
Contributors: @alex-ozdemir, @cuviper, @dingelish, @Speedy37, @youknowone
Release 0.2.3 (2019-09-03)
Powis now implemented forBigUintexponents.- The optional
quickcheckfeature enables implementations ofArbitrary. - See the full comparison for performance enhancements and more!
Contributors: @cuviper, @lcnr, @maxbla, @mikelodder7, @mikong, @TheLetterTheta, @tspiteri, @XAMPPRocky, @youknowone
Release 0.2.2 (2018-12-14)
- The
Rootsimplementations now use better initial guesses. - Fixed
to_signed_bytes_*for some positive numbers, where the most-significant byte is0x80and the rest are0.
Contributors: @cuviper, @leodasvacas
Release 0.2.1 (2018-11-02)
RandBigIntnow usesRng::fill_bytesto improve performance, instead of repeatedgen::<u32>calls. The also affects the implementations of the otherrandtraits. This may potentially change the values produced by some seeded RNGs on previous versions, but the values were tested to be stable withChaChaRng,IsaacRng, andXorShiftRng.BigIntandBigUintnow implementnum_integer::Roots.BigIntandBigUintnow implementnum_traits::Pow.BigIntandBigUintnow implement operators with 128-bit integers.
Contributors: @cuviper, @dignifiedquire, @mancabizjak, @Robbepop, @TheIronBorn, @thomwiggers
Release 0.2.0 (2018-05-25)
Enhancements
BigIntandBigUintnow implementProductandSumfor iterators of any item that we canMulandAdd, respectively. For example, a factorial can now be simply:let f: BigUint = (1u32..1000).product();BigIntnow supports two's-complement logic operations, namelyBitAnd,BitOr,BitXor, andNot. These act conceptually as if each number had an infinite prefix of0or1bits for positive or negative.BigIntnow supports assignment operators likeAddAssign.BigIntandBigUintnow support conversions withi128andu128, if sufficient compiler support is detected.BigIntandBigUintnow implement rand'sSampleUniformtrait, and a customRandomBitsdistribution samples by bit size.- The release also includes other miscellaneous improvements to performance.
Breaking Changes
num-bigintnow requires rustc 1.15 or greater.- The crate now has a
stdfeature, and won't build without it. This is in preparation for someday supporting#![no_std]withalloc. - The
serdedependency has been updated to 1.0, still disabled by default. Therustc-serializecrate is no longer supported bynum-bigint. - The
randdependency has been updated to 0.5, now disabled by default. This requires rustc 1.22 or greater forrand'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.- The
big_digitmodule is no longer public, nor are theBigDigitandDoubleBigDigittypes andZERO_BIG_DIGITconstant that were re-exported in the crate root. Public APIs which deal in digits, likeBigUint::from_slice, will now always be base-u32.
Contributors: @clarcharr, @cuviper, @dodomorandi, @tiehuis, @tspiteri
Release 0.1.44 (2018-05-14)
- Division with single-digit divisors is now much faster.
- The README now compares
ramp,rug,rust-gmp, andapint.
Contributors: @cuviper, @Robbepop
Release 0.1.43 (2018-02-08)
- The new
BigInt::modpowperforms signed modular exponentiation, using the existingBigUint::modpowand rounding negatives similar tomod_floor.
Contributors: @cuviper
Release 0.1.42 (2018-02-07)
- num-bigint now has its own source repository at rust-num/num-bigint.
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
Prior releases
No prior release notes were kept. Thanks all the same to the many contributors that have made this crate what it is!