1# Release 0.4.3 (2021-11-02) 2 3- [GHSA-v935-pqmr-g8v9]: [Fix unexpected panics in multiplication.][228] 4 5**Contributors**: @arvidn, @cuviper, @guidovranken 6 7[228]: https://github.com/rust-num/num-bigint/pull/228 8[GHSA-v935-pqmr-g8v9]: https://github.com/rust-num/num-bigint/security/advisories/GHSA-v935-pqmr-g8v9 9 10# Release 0.4.2 (2021-09-03) 11 12- [Use explicit `Integer::div_ceil` to avoid the new unstable method.][219] 13 14**Contributors**: @catenacyber, @cuviper 15 16[219]: https://github.com/rust-num/num-bigint/pull/219 17 18# Release 0.4.1 (2021-08-27) 19 20- [Fixed scalar divide-by-zero panics.][200] 21- [Implemented `DoubleEndedIterator` for `U32Digits` and `U64Digits`.][208] 22- [Optimized multiplication to avoid unnecessary allocations.][199] 23- [Optimized string formatting for very large values.][216] 24 25**Contributors**: @cuviper, @PatrickNorton 26 27[199]: https://github.com/rust-num/num-bigint/pull/199 28[200]: https://github.com/rust-num/num-bigint/pull/200 29[208]: https://github.com/rust-num/num-bigint/pull/208 30[216]: https://github.com/rust-num/num-bigint/pull/216 31 32# Release 0.4.0 (2021-03-05) 33 34### Breaking Changes 35 36- Updated public dependences on [arbitrary, quickcheck][194], and [rand][185]: 37 - `arbitrary` support has been updated to 1.0, requiring Rust 1.40. 38 - `quickcheck` support has been updated to 1.0, requiring Rust 1.46. 39 - `rand` support has been updated to 0.8, requiring Rust 1.36. 40- [`Debug` now shows plain numeric values for `BigInt` and `BigUint`][195], 41 rather than the raw list of internal digits. 42 43**Contributors**: @cuviper, @Gelbpunkt 44 45[185]: https://github.com/rust-num/num-bigint/pull/185 46[194]: https://github.com/rust-num/num-bigint/pull/194 47[195]: https://github.com/rust-num/num-bigint/pull/195 48 49# Release 0.3.3 (2021-09-03) 50 51- [Use explicit `Integer::div_ceil` to avoid the new unstable method.][219] 52 53**Contributors**: @catenacyber, @cuviper 54 55# Release 0.3.2 (2021-03-04) 56 57- [The new `BigUint` methods `count_ones` and `trailing_ones`][175] return the 58 number of `1` bits in the entire value or just its least-significant tail, 59 respectively. 60- [The new `BigInt` and `BigUint` methods `bit` and `set_bit`][183] will read 61 and write individual bits of the value. For negative `BigInt`, bits are 62 determined as if they were in the two's complement representation. 63- [The `from_radix_le` and `from_radix_be` methods][187] now accept empty 64 buffers to represent zero. 65- [`BigInt` and `BigUint` can now iterate digits as `u32` or `u64`][192], 66 regardless of the actual internal digit size. 67 68**Contributors**: @BartMassey, @cuviper, @janmarthedal, @sebastianv89, @Speedy37 69 70[175]: https://github.com/rust-num/num-bigint/pull/175 71[183]: https://github.com/rust-num/num-bigint/pull/183 72[187]: https://github.com/rust-num/num-bigint/pull/187 73[192]: https://github.com/rust-num/num-bigint/pull/192 74 75# Release 0.3.1 (2020-11-03) 76 77- [Addition and subtraction now uses intrinsics][141] for performance on `x86` 78 and `x86_64` when built with Rust 1.33 or later. 79- [Conversions `to_f32` and `to_f64` now return infinity][163] for very large 80 numbers, rather than `None`. This does preserve the sign too, so a large 81 negative `BigInt` will convert to negative infinity. 82- [The optional `arbitrary` feature implements `arbitrary::Arbitrary`][166], 83 distinct from `quickcheck::Arbitrary`. 84- [The division algorithm has been optimized][170] to reduce the number of 85 temporary allocations and improve the internal guesses at each step. 86- [`BigInt` and `BigUint` will opportunistically shrink capacity][171] if the 87 internal vector is much larger than needed. 88 89**Contributors**: @cuviper, @e00E, @ejmahler, @notoria, @tczajka 90 91[141]: https://github.com/rust-num/num-bigint/pull/141 92[163]: https://github.com/rust-num/num-bigint/pull/163 93[166]: https://github.com/rust-num/num-bigint/pull/166 94[170]: https://github.com/rust-num/num-bigint/pull/170 95[171]: https://github.com/rust-num/num-bigint/pull/171 96 97# Release 0.3.0 (2020-06-12) 98 99### Enhancements 100 101- [The internal `BigDigit` may now be either `u32` or `u64`][62], although that 102 implementation detail is not exposed in the API. For now, this is chosen to 103 match the target pointer size, but may change in the future. 104- [No-`std` is now supported with the `alloc` crate on Rust 1.36][101]. 105- [`Pow` is now implemented for bigint values][137], not just references. 106- [`TryFrom` is now implemented on Rust 1.34 and later][123], converting signed 107 integers to unsigned, and narrowing big integers to primitives. 108- [`Shl` and `Shr` are now implemented for a variety of shift types][142]. 109- A new `trailing_zeros()` returns the number of consecutive zeros from the 110 least significant bit. 111- The new `BigInt::magnitude` and `into_parts` methods give access to its 112 `BigUint` part as the magnitude. 113 114### Breaking Changes 115 116- `num-bigint` now requires Rust 1.31 or greater. 117 - The "i128" opt-in feature was removed, now always available. 118- [Updated public dependences][110]: 119 - `rand` support has been updated to 0.7, requiring Rust 1.32. 120 - `quickcheck` support has been updated to 0.9, requiring Rust 1.34. 121- [Removed `impl Neg for BigUint`][145], which only ever panicked. 122- [Bit counts are now `u64` instead of `usize`][143]. 123 124**Contributors**: @cuviper, @dignifiedquire, @hansihe, 125@kpcyrd, @milesand, @tech6hutch 126 127[62]: https://github.com/rust-num/num-bigint/pull/62 128[101]: https://github.com/rust-num/num-bigint/pull/101 129[110]: https://github.com/rust-num/num-bigint/pull/110 130[123]: https://github.com/rust-num/num-bigint/pull/123 131[137]: https://github.com/rust-num/num-bigint/pull/137 132[142]: https://github.com/rust-num/num-bigint/pull/142 133[143]: https://github.com/rust-num/num-bigint/pull/143 134[145]: https://github.com/rust-num/num-bigint/pull/145 135 136# Release 0.2.6 (2020-01-27) 137 138- [Fix the promotion of negative `isize` in `BigInt` assign-ops][133]. 139 140**Contributors**: @cuviper, @HactarCE 141 142[133]: https://github.com/rust-num/num-bigint/pull/133 143 144# Release 0.2.5 (2020-01-09) 145 146- [Updated the `autocfg` build dependency to 1.0][126]. 147 148**Contributors**: @cuviper, @tspiteri 149 150[126]: https://github.com/rust-num/num-bigint/pull/126 151 152# Release 0.2.4 (2020-01-01) 153 154- [The new `BigUint::to_u32_digits` method][104] returns the number as a 155 little-endian vector of base-2<sup>32</sup> digits. The same method on 156 `BigInt` also returns the sign. 157- [`BigUint::modpow` now applies a modulus even for exponent 1][113], which 158 also affects `BigInt::modpow`. 159- [`BigInt::modpow` now returns the correct sign for negative bases with even 160 exponents][114]. 161 162[104]: https://github.com/rust-num/num-bigint/pull/104 163[113]: https://github.com/rust-num/num-bigint/pull/113 164[114]: https://github.com/rust-num/num-bigint/pull/114 165 166**Contributors**: @alex-ozdemir, @cuviper, @dingelish, @Speedy37, @youknowone 167 168# Release 0.2.3 (2019-09-03) 169 170- [`Pow` is now implemented for `BigUint` exponents][77]. 171- [The optional `quickcheck` feature enables implementations of `Arbitrary`][99]. 172- See the [full comparison][compare-0.2.3] for performance enhancements and more! 173 174[77]: https://github.com/rust-num/num-bigint/pull/77 175[99]: https://github.com/rust-num/num-bigint/pull/99 176[compare-0.2.3]: https://github.com/rust-num/num-bigint/compare/num-bigint-0.2.2...num-bigint-0.2.3 177 178**Contributors**: @cuviper, @lcnr, @maxbla, @mikelodder7, @mikong, 179@TheLetterTheta, @tspiteri, @XAMPPRocky, @youknowone 180 181# Release 0.2.2 (2018-12-14) 182 183- [The `Roots` implementations now use better initial guesses][71]. 184- [Fixed `to_signed_bytes_*` for some positive numbers][72], where the 185 most-significant byte is `0x80` and the rest are `0`. 186 187[71]: https://github.com/rust-num/num-bigint/pull/71 188[72]: https://github.com/rust-num/num-bigint/pull/72 189 190**Contributors**: @cuviper, @leodasvacas 191 192# Release 0.2.1 (2018-11-02) 193 194- [`RandBigInt` now uses `Rng::fill_bytes`][53] to improve performance, instead 195 of repeated `gen::<u32>` calls. The also affects the implementations of the 196 other `rand` traits. This may potentially change the values produced by some 197 seeded RNGs on previous versions, but the values were tested to be stable 198 with `ChaChaRng`, `IsaacRng`, and `XorShiftRng`. 199- [`BigInt` and `BigUint` now implement `num_integer::Roots`][56]. 200- [`BigInt` and `BigUint` now implement `num_traits::Pow`][54]. 201- [`BigInt` and `BigUint` now implement operators with 128-bit integers][64]. 202 203**Contributors**: @cuviper, @dignifiedquire, @mancabizjak, @Robbepop, 204@TheIronBorn, @thomwiggers 205 206[53]: https://github.com/rust-num/num-bigint/pull/53 207[54]: https://github.com/rust-num/num-bigint/pull/54 208[56]: https://github.com/rust-num/num-bigint/pull/56 209[64]: https://github.com/rust-num/num-bigint/pull/64 210 211# Release 0.2.0 (2018-05-25) 212 213### Enhancements 214 215- [`BigInt` and `BigUint` now implement `Product` and `Sum`][22] for iterators 216 of any item that we can `Mul` and `Add`, respectively. For example, a 217 factorial can now be simply: `let f: BigUint = (1u32..1000).product();` 218- [`BigInt` now supports two's-complement logic operations][26], namely 219 `BitAnd`, `BitOr`, `BitXor`, and `Not`. These act conceptually as if each 220 number had an infinite prefix of `0` or `1` bits for positive or negative. 221- [`BigInt` now supports assignment operators][41] like `AddAssign`. 222- [`BigInt` and `BigUint` now support conversions with `i128` and `u128`][44], 223 if sufficient compiler support is detected. 224- [`BigInt` and `BigUint` now implement rand's `SampleUniform` trait][48], and 225 [a custom `RandomBits` distribution samples by bit size][49]. 226- The release also includes other miscellaneous improvements to performance. 227 228### Breaking Changes 229 230- [`num-bigint` now requires rustc 1.15 or greater][23]. 231- [The crate now has a `std` feature, and won't build without it][46]. This is 232 in preparation for someday supporting `#![no_std]` with `alloc`. 233- [The `serde` dependency has been updated to 1.0][24], still disabled by 234 default. The `rustc-serialize` crate is no longer supported by `num-bigint`. 235- [The `rand` dependency has been updated to 0.5][48], now disabled by default. 236 This requires rustc 1.22 or greater for `rand`'s own requirement. 237- [`Shr for BigInt` now rounds down][8] rather than toward zero, matching the 238 behavior of the primitive integers for negative values. 239- [`ParseBigIntError` is now an opaque type][37]. 240- [The `big_digit` module is no longer public][38], nor are the `BigDigit` and 241 `DoubleBigDigit` types and `ZERO_BIG_DIGIT` constant that were re-exported in 242 the crate root. Public APIs which deal in digits, like `BigUint::from_slice`, 243 will now always be base-`u32`. 244 245**Contributors**: @clarcharr, @cuviper, @dodomorandi, @tiehuis, @tspiteri 246 247[8]: https://github.com/rust-num/num-bigint/pull/8 248[22]: https://github.com/rust-num/num-bigint/pull/22 249[23]: https://github.com/rust-num/num-bigint/pull/23 250[24]: https://github.com/rust-num/num-bigint/pull/24 251[26]: https://github.com/rust-num/num-bigint/pull/26 252[37]: https://github.com/rust-num/num-bigint/pull/37 253[38]: https://github.com/rust-num/num-bigint/pull/38 254[41]: https://github.com/rust-num/num-bigint/pull/41 255[44]: https://github.com/rust-num/num-bigint/pull/44 256[46]: https://github.com/rust-num/num-bigint/pull/46 257[48]: https://github.com/rust-num/num-bigint/pull/48 258[49]: https://github.com/rust-num/num-bigint/pull/49 259 260# Release 0.1.44 (2018-05-14) 261 262- [Division with single-digit divisors is now much faster.][42] 263- The README now compares [`ramp`, `rug`, `rust-gmp`][20], and [`apint`][21]. 264 265**Contributors**: @cuviper, @Robbepop 266 267[20]: https://github.com/rust-num/num-bigint/pull/20 268[21]: https://github.com/rust-num/num-bigint/pull/21 269[42]: https://github.com/rust-num/num-bigint/pull/42 270 271# Release 0.1.43 (2018-02-08) 272 273- [The new `BigInt::modpow`][18] performs signed modular exponentiation, using 274 the existing `BigUint::modpow` and rounding negatives similar to `mod_floor`. 275 276**Contributors**: @cuviper 277 278[18]: https://github.com/rust-num/num-bigint/pull/18 279 280 281# Release 0.1.42 (2018-02-07) 282 283- [num-bigint now has its own source repository][num-356] at [rust-num/num-bigint][home]. 284- [`lcm` now avoids creating a large intermediate product][num-350]. 285- [`gcd` now uses Stein's algorithm][15] with faster shifts instead of division. 286- [`rand` support is now extended to 0.4][11] (while still allowing 0.3). 287 288**Contributors**: @cuviper, @Emerentius, @ignatenkobrain, @mhogrefe 289 290[home]: https://github.com/rust-num/num-bigint 291[num-350]: https://github.com/rust-num/num/pull/350 292[num-356]: https://github.com/rust-num/num/pull/356 293[11]: https://github.com/rust-num/num-bigint/pull/11 294[15]: https://github.com/rust-num/num-bigint/pull/15 295 296 297# Prior releases 298 299No prior release notes were kept. Thanks all the same to the many 300contributors that have made this crate what it is! 301 302