1# Release 0.2.14 (2020-10-29) 2 3- Clarify the license specification as "MIT OR Apache-2.0". 4 5**Contributors**: @cuviper 6 7# Release 0.2.13 (2020-10-29) 8 9- [The new `OverflowingAdd`, `OverflowingSub`, and `OverflowingMul` traits][180] 10 return a tuple with the operation result and a `bool` indicating overflow. 11- [The "i128" feature now overrides compiler probes for that support][185]. 12 This may fix scenarios where `autocfg` probing doesn't work properly. 13- [Casts from large `f64` values to `f32` now saturate to infinity][186]. They 14 previously returned `None` because that was once thought to be undefined 15 behavior, but [rust#15536] resolved that such casts are fine. 16- [`Num::from_str_radix` documents requirements for radix support][192], which 17 are now more relaxed than previously implied. It is suggested to accept at 18 least `2..=36` without panicking, but `Err` may be returned otherwise. 19 20**Contributors**: @cuviper, @Enet4, @KaczuH, @martin-t, @newpavlov 21 22[180]: https://github.com/rust-num/num-traits/pull/180 23[185]: https://github.com/rust-num/num-traits/pull/185 24[186]: https://github.com/rust-num/num-traits/pull/186 25[192]: https://github.com/rust-num/num-traits/issues/192 26[rust#15536]: https://github.com/rust-lang/rust/issues/15536 27 28# Release 0.2.12 (2020-06-11) 29 30- [The new `WrappingNeg` trait][153] will wrap the result if it exceeds the 31 boundary of the type, e.g. `i32::MIN.wrapping_neg() == i32::MIN`. 32- [The new `SaturatingAdd`, `SaturatingSub`, and `SaturatingMul` traits][165] 33 will saturate at the numeric bounds if the operation would overflow. These 34 soft-deprecate the existing `Saturating` trait that only has addition and 35 subtraction methods. 36- [Added new constants for logarithms, `FloatConst::{LOG10_2, LOG2_10}`][171]. 37 38**Contributors**: @cuviper, @ocstl, @trepetti, @vallentin 39 40[153]: https://github.com/rust-num/num-traits/pull/153 41[165]: https://github.com/rust-num/num-traits/pull/165 42[171]: https://github.com/rust-num/num-traits/pull/171 43 44# Release 0.2.11 (2020-01-09) 45 46- [Added the full circle constant τ as `FloatConst::TAU`][145]. 47- [Updated the `autocfg` build dependency to 1.0][148]. 48 49**Contributors**: @cuviper, @m-ou-se 50 51[145]: https://github.com/rust-num/num-traits/pull/145 52[148]: https://github.com/rust-num/num-traits/pull/148 53 54# Release 0.2.10 (2019-11-22) 55 56- [Updated the `libm` dependency to 0.2][144]. 57 58**Contributors**: @CryZe 59 60[144]: https://github.com/rust-num/num-traits/pull/144 61 62# Release 0.2.9 (2019-11-12) 63 64- [A new optional `libm` dependency][99] enables the `Float` and `Real` traits 65 in `no_std` builds. 66- [The new `clamp_min` and `clamp_max`][122] limit minimum and maximum values 67 while preserving input `NAN`s. 68- [Fixed a panic in floating point `from_str_radix` on invalid signs][126]. 69- Miscellaneous documentation updates. 70 71**Contributors**: @cuviper, @dingelish, @HeroicKatora, @jturner314, @ocstl, 72@Shnatsel, @termoshtt, @waywardmonkeys, @yoanlcq 73 74[99]: https://github.com/rust-num/num-traits/pull/99 75[122]: https://github.com/rust-num/num-traits/pull/122 76[126]: https://github.com/rust-num/num-traits/pull/126 77 78# Release 0.2.8 (2019-05-21) 79 80- [Fixed feature detection on `no_std` targets][116]. 81 82**Contributors**: @cuviper 83 84[116]: https://github.com/rust-num/num-traits/pull/116 85 86# Release 0.2.7 (2019-05-20) 87 88- [Documented when `CheckedShl` and `CheckedShr` return `None`][90]. 89- [The new `Zero::set_zero` and `One::set_one`][104] will set values to their 90 identities in place, possibly optimized better than direct assignment. 91- [Documented general features and intentions of `PrimInt`][108]. 92 93**Contributors**: @cuviper, @dvdhrm, @ignatenkobrain, @lcnr, @samueltardieu 94 95[90]: https://github.com/rust-num/num-traits/pull/90 96[104]: https://github.com/rust-num/num-traits/pull/104 97[108]: https://github.com/rust-num/num-traits/pull/108 98 99# Release 0.2.6 (2018-09-13) 100 101- [Documented that `pow(0, 0)` returns `1`][79]. Mathematically, this is not 102 strictly defined, but the current behavior is a pragmatic choice that has 103 precedent in Rust `core` for the primitives and in many other languages. 104- [The new `WrappingShl` and `WrappingShr` traits][81] will wrap the shift count 105 if it exceeds the bit size of the type. 106 107**Contributors**: @cuviper, @edmccard, @meltinglava 108 109[79]: https://github.com/rust-num/num-traits/pull/79 110[81]: https://github.com/rust-num/num-traits/pull/81 111 112# Release 0.2.5 (2018-06-20) 113 114- [Documentation for `mul_add` now clarifies that it's not always faster.][70] 115- [The default methods in `FromPrimitive` and `ToPrimitive` are more robust.][73] 116 117**Contributors**: @cuviper, @frewsxcv 118 119[70]: https://github.com/rust-num/num-traits/pull/70 120[73]: https://github.com/rust-num/num-traits/pull/73 121 122# Release 0.2.4 (2018-05-11) 123 124- [Support for 128-bit integers is now automatically detected and enabled.][69] 125 Setting the `i128` crate feature now causes the build script to panic if such 126 support is not detected. 127 128**Contributors**: @cuviper 129 130[69]: https://github.com/rust-num/num-traits/pull/69 131 132# Release 0.2.3 (2018-05-10) 133 134- [The new `CheckedNeg` and `CheckedRem` traits][63] perform checked `Neg` and 135 `Rem`, returning `Some(output)` or `None` on overflow. 136- [The `no_std` implementation of `FloatCore::to_degrees` for `f32`][61] now 137 uses a constant for greater accuracy, mirroring [rust#47919]. (With `std` it 138 just calls the inherent `f32::to_degrees` in the standard library.) 139- [The new `MulAdd` and `MulAddAssign` traits][59] perform a fused multiply- 140 add. For integer types this is just a convenience, but for floating point 141 types this produces a more accurate result than the separate operations. 142- [All applicable traits are now implemented for 128-bit integers][60] starting 143 with Rust 1.26, enabled by the new `i128` crate feature. The `FromPrimitive` 144 and `ToPrimitive` traits now also have corresponding 128-bit methods, which 145 default to converting via 64-bit integers for compatibility. 146 147**Contributors**: @cuviper, @LEXUGE, @regexident, @vks 148 149[59]: https://github.com/rust-num/num-traits/pull/59 150[60]: https://github.com/rust-num/num-traits/pull/60 151[61]: https://github.com/rust-num/num-traits/pull/61 152[63]: https://github.com/rust-num/num-traits/pull/63 153[rust#47919]: https://github.com/rust-lang/rust/pull/47919 154 155# Release 0.2.2 (2018-03-18) 156 157- [Casting from floating point to integers now returns `None` on overflow][52], 158 avoiding [rustc's undefined behavior][rust-10184]. This applies to the `cast` 159 function and the traits `NumCast`, `FromPrimitive`, and `ToPrimitive`. 160 161**Contributors**: @apopiak, @cuviper, @dbarella 162 163[52]: https://github.com/rust-num/num-traits/pull/52 164[rust-10184]: https://github.com/rust-lang/rust/issues/10184 165 166 167# Release 0.2.1 (2018-03-01) 168 169- [The new `FloatCore` trait][32] offers a subset of `Float` for `#![no_std]` use. 170 [This includes everything][41] except the transcendental functions and FMA. 171- [The new `Inv` trait][37] returns the multiplicative inverse, or reciprocal. 172- [The new `Pow` trait][37] performs exponentiation, much like the existing `pow` 173 function, but with generic exponent types. 174- [The new `One::is_one` method][39] tests if a value equals 1. Implementers 175 should override this method if there's a more efficient way to check for 1, 176 rather than comparing with a temporary `one()`. 177 178**Contributors**: @clarcharr, @cuviper, @vks 179 180[32]: https://github.com/rust-num/num-traits/pull/32 181[37]: https://github.com/rust-num/num-traits/pull/37 182[39]: https://github.com/rust-num/num-traits/pull/39 183[41]: https://github.com/rust-num/num-traits/pull/41 184 185 186# Release 0.2.0 (2018-02-06) 187 188- **breaking change**: [There is now a `std` feature][30], enabled by default, along 189 with the implication that building *without* this feature makes this a 190 `#![no_std]` crate. 191 - The `Float` and `Real` traits are only available when `std` is enabled. 192 - Otherwise, the API is unchanged, and num-traits 0.1.43 now re-exports its 193 items from num-traits 0.2 for compatibility (the [semver-trick]). 194 195**Contributors**: @cuviper, @termoshtt, @vks 196 197[semver-trick]: https://github.com/dtolnay/semver-trick 198[30]: https://github.com/rust-num/num-traits/pull/30 199 200 201# Release 0.1.43 (2018-02-06) 202 203- All items are now [re-exported from num-traits 0.2][31] for compatibility. 204 205[31]: https://github.com/rust-num/num-traits/pull/31 206 207 208# Release 0.1.42 (2018-01-22) 209 210- [num-traits now has its own source repository][num-356] at [rust-num/num-traits][home]. 211- [`ParseFloatError` now implements `Display`][22]. 212- [The new `AsPrimitive` trait][17] implements generic casting with the `as` operator. 213- [The new `CheckedShl` and `CheckedShr` traits][21] implement generic 214 support for the `checked_shl` and `checked_shr` methods on primitive integers. 215- [The new `Real` trait][23] offers a subset of `Float` functionality that may be applicable to more 216 types, with a blanket implementation for all existing `T: Float` types. 217 218Thanks to @cuviper, @Enet4, @fabianschuiki, @svartalf, and @yoanlcq for their contributions! 219 220[home]: https://github.com/rust-num/num-traits 221[num-356]: https://github.com/rust-num/num/pull/356 222[17]: https://github.com/rust-num/num-traits/pull/17 223[21]: https://github.com/rust-num/num-traits/pull/21 224[22]: https://github.com/rust-num/num-traits/pull/22 225[23]: https://github.com/rust-num/num-traits/pull/23 226 227 228# Prior releases 229 230No prior release notes were kept. Thanks all the same to the many 231contributors that have made this crate what it is! 232