| 1 | # Release 0.4.2 (2024-05-07) |
| 2 | |
| 3 | - [Upgrade to 2021 edition, **MSRV 1.60**][126] |
| 4 | - [Add `Ratio::approximate_float_unsigned` to convert `FloatCore` types to unsigned][109] |
| 5 | - [Add `const ZERO` and `ONE`, and implement `num_traits::ConstZero` and `ConstOne`][128] |
| 6 | - [Add `Ratio::into_raw` to deconstruct the numerator and denominator][129] |
| 7 | |
| 8 | **Contributors**: @cuviper, @Enyium, @flavioroth, @waywardmonkeys |
| 9 | |
| 10 | [109]: https://github.com/rust-num/num-rational/pull/109 |
| 11 | [126]: https://github.com/rust-num/num-rational/pull/126 |
| 12 | [128]: https://github.com/rust-num/num-rational/pull/128 |
| 13 | [129]: https://github.com/rust-num/num-rational/pull/129 |
| 14 | |
| 15 | # Release 0.4.1 (2022-06-23) |
| 16 | |
| 17 | - [Fewer `clone` calls are used when reducing a new `Ratio<T>`][98]. |
| 18 | - [Conversions to floating point are better at avoiding underflow][104]. |
| 19 | - [`Ratio<T>` now implements `Default`][105], returning a zero value. |
| 20 | |
| 21 | **Contributors**: @cuviper, @lemmih, @MattX |
| 22 | |
| 23 | [98]: https://github.com/rust-num/num-rational/pull/98 |
| 24 | [104]: https://github.com/rust-num/num-rational/pull/104 |
| 25 | [105]: https://github.com/rust-num/num-rational/pull/105 |
| 26 | |
| 27 | # Release 0.4.0 (2021-03-05) |
| 28 | |
| 29 | - The optional `num-bigint` dependency is now 0.4. |
| 30 | - [The `Rational` alias for `Ratio<usize>` is now deprecated][92]. It is |
| 31 | recommended to use specific type sizes for numeric computation, like |
| 32 | `Rational32` and `Rational64`. |
| 33 | |
| 34 | **Contributors**: @cuviper, @vks |
| 35 | |
| 36 | [92]: https://github.com/rust-num/num-rational/pull/92 |
| 37 | |
| 38 | # Release 0.3.2 (2020-11-06) |
| 39 | |
| 40 | - [Fix always rebuilding with --remap-path-prefix][88] |
| 41 | |
| 42 | **Contributors**: @Nemo157 |
| 43 | |
| 44 | [88]: https://github.com/rust-num/num-rational/pull/88 |
| 45 | |
| 46 | # Release 0.3.1 (2020-10-29) |
| 47 | |
| 48 | - [Handle to_f64() with raw division by zero][83]. |
| 49 | - [Better document panic behaviour][84]. |
| 50 | - Clarify the license specification as "MIT OR Apache-2.0". |
| 51 | |
| 52 | **Contributors**: @cuviper, @zetok |
| 53 | |
| 54 | [83]: https://github.com/rust-num/num-rational/pull/83 |
| 55 | [84]: https://github.com/rust-num/num-rational/pull/84 |
| 56 | |
| 57 | # Release 0.3.0 (2020-06-13) |
| 58 | |
| 59 | ### Enhancements |
| 60 | |
| 61 | - [`Ratio` now implements `ToPrimitive`][52]. |
| 62 | - [`Ratio` now implements additional formatting traits][56]: |
| 63 | - `Binary`, `Octal`, `LowerHex`, `UpperHex`, `LowerExp`, `UpperExp` |
| 64 | - [The `Pow` implementations have been expanded][70]. |
| 65 | - `Pow<BigInt>` and `Pow<BigUint>` are now implemented. |
| 66 | - `Pow<_> for &Ratio<T>` now uses `&T: Pow`. |
| 67 | - The inherent `pow` method now uses `&T: Pow`. |
| 68 | |
| 69 | ### Breaking Changes |
| 70 | |
| 71 | - [`num-rational` now requires Rust 1.31 or greater][66]. |
| 72 | - The "i128" opt-in feature was removed, now always available. |
| 73 | - [The "num-bigint-std" feature replaces "bigint" with `std` enabled][80]. |
| 74 | - The "num-bigint" feature without `std` uses `alloc` on Rust 1.36+. |
| 75 | |
| 76 | **Contributors**: @cuviper, @MattX, @maxbla |
| 77 | |
| 78 | [52]: https://github.com/rust-num/num-rational/pull/52 |
| 79 | [56]: https://github.com/rust-num/num-rational/pull/56 |
| 80 | [66]: https://github.com/rust-num/num-rational/pull/66 |
| 81 | [70]: https://github.com/rust-num/num-rational/pull/70 |
| 82 | [80]: https://github.com/rust-num/num-rational/pull/80 |
| 83 | |
| 84 | # Release 0.2.4 (2020-03-17) |
| 85 | |
| 86 | - [Fixed `CheckedDiv` when both dividend and divisor are 0][74]. |
| 87 | - [Fixed `CheckedDiv` with `min_value()` numerators][76]. |
| 88 | |
| 89 | [74]: https://github.com/rust-num/num-rational/pull/74 |
| 90 | [76]: https://github.com/rust-num/num-rational/pull/76 |
| 91 | |
| 92 | # Release 0.2.3 (2020-01-09) |
| 93 | |
| 94 | - [`Ratio` now performs earlier reductions to avoid overflow with `+-*/%` operators][42]. |
| 95 | - [`Ratio::{new_raw, numer, denom}` are now `const fn` for Rust 1.31 and later][48]. |
| 96 | - [Updated the `autocfg` build dependency to 1.0][63]. |
| 97 | |
| 98 | **Contributors**: @cuviper, @dingelish, @jimbo1qaz, @maxbla |
| 99 | |
| 100 | [42]: https://github.com/rust-num/num-rational/pull/42 |
| 101 | [48]: https://github.com/rust-num/num-rational/pull/48 |
| 102 | [63]: https://github.com/rust-num/num-rational/pull/63 |
| 103 | |
| 104 | # Release 0.2.2 (2019-06-10) |
| 105 | |
| 106 | - [`Ratio` now implements `Zero::set_zero` and `One::set_one`][47]. |
| 107 | |
| 108 | **Contributors**: @cuviper, @ignatenkobrain, @vks |
| 109 | |
| 110 | [47]: https://github.com/rust-num/num-rational/pull/47 |
| 111 | |
| 112 | # Release 0.2.1 (2018-06-22) |
| 113 | |
| 114 | - Maintenance release to fix `html_root_url`. |
| 115 | |
| 116 | # Release 0.2.0 (2018-06-19) |
| 117 | |
| 118 | ### Enhancements |
| 119 | |
| 120 | - [`Ratio` now implements `One::is_one` and the `Inv` trait][19]. |
| 121 | - [`Ratio` now implements `Sum` and `Product`][25]. |
| 122 | - [`Ratio` now supports `i128` and `u128` components][29] with Rust 1.26+. |
| 123 | - [`Ratio` now implements the `Pow` trait][21]. |
| 124 | |
| 125 | ### Breaking Changes |
| 126 | |
| 127 | - [`num-rational` now requires rustc 1.15 or greater][18]. |
| 128 | - [There is now a `std` feature][23], enabled by default, along with the |
| 129 | implication that building *without* this feature makes this a `#![no_std]` |
| 130 | crate. A few methods now require `FloatCore` instead of `Float`. |
| 131 | - [The `serde` dependency has been updated to 1.0][24], and `rustc-serialize` |
| 132 | is no longer supported by `num-rational`. |
| 133 | - The optional `num-bigint` dependency has been updated to 0.2, and should be |
| 134 | enabled using the `bigint-std` feature. In the future, it may be possible |
| 135 | to use the `bigint` feature with `no_std`. |
| 136 | |
| 137 | **Contributors**: @clarcharr, @cuviper, @Emerentius, @robomancer-or, @vks |
| 138 | |
| 139 | [18]: https://github.com/rust-num/num-rational/pull/18 |
| 140 | [19]: https://github.com/rust-num/num-rational/pull/19 |
| 141 | [21]: https://github.com/rust-num/num-rational/pull/21 |
| 142 | [23]: https://github.com/rust-num/num-rational/pull/23 |
| 143 | [24]: https://github.com/rust-num/num-rational/pull/24 |
| 144 | [25]: https://github.com/rust-num/num-rational/pull/25 |
| 145 | [29]: https://github.com/rust-num/num-rational/pull/29 |
| 146 | |
| 147 | |
| 148 | # Release 0.1.42 (2018-02-08) |
| 149 | |
| 150 | - Maintenance release to update dependencies. |
| 151 | |
| 152 | |
| 153 | # Release 0.1.41 (2018-01-26) |
| 154 | |
| 155 | - [num-rational now has its own source repository][num-356] at [rust-num/num-rational][home]. |
| 156 | - [`Ratio` now implements `CheckedAdd`, `CheckedSub`, `CheckedMul`, and `CheckedDiv`][11]. |
| 157 | - [`Ratio` now implements `AddAssign`, `SubAssign`, `MulAssign`, `DivAssign`, and `RemAssign`][12] |
| 158 | with either `Ratio` or an integer on the right side. The non-assignment operators now also |
| 159 | accept integers as an operand. |
| 160 | - [`Ratio` operators now make fewer `clone()` calls][14]. |
| 161 | |
| 162 | Thanks to @c410-f3r, @cuviper, and @psimonyi for their contributions! |
| 163 | |
| 164 | [home]: https://github.com/rust-num/num-rational |
| 165 | [num-356]: https://github.com/rust-num/num/pull/356 |
| 166 | [11]: https://github.com/rust-num/num-rational/pull/11 |
| 167 | [12]: https://github.com/rust-num/num-rational/pull/12 |
| 168 | [14]: https://github.com/rust-num/num-rational/pull/14 |
| 169 | |
| 170 | |
| 171 | # Prior releases |
| 172 | |
| 173 | No prior release notes were kept. Thanks all the same to the many |
| 174 | contributors that have made this crate what it is! |