1# Release 0.2.8 (2019-05-21) 2 3- [Fixed feature detection on `no_std` targets][116]. 4 5**Contributors**: @cuviper 6 7[116]: https://github.com/rust-num/num-traits/pull/116 8 9# Release 0.2.7 (2019-05-20) 10 11- [Documented when `CheckedShl` and `CheckedShr` return `None`][90]. 12- [The new `Zero::set_zero` and `One::set_one`][104] will set values to their 13 identities in place, possibly optimized better than direct assignment. 14- [Documented general features and intentions of `PrimInt`][108]. 15 16**Contributors**: @cuviper, @dvdhrm, @ignatenkobrain, @lcnr, @samueltardieu 17 18[90]: https://github.com/rust-num/num-traits/pull/90 19[104]: https://github.com/rust-num/num-traits/pull/104 20[108]: https://github.com/rust-num/num-traits/pull/108 21 22# Release 0.2.6 (2018-09-13) 23 24- [Documented that `pow(0, 0)` returns `1`][79]. Mathematically, this is not 25 strictly defined, but the current behavior is a pragmatic choice that has 26 precedent in Rust `core` for the primitives and in many other languages. 27- [The new `WrappingShl` and `WrappingShr` traits][81] will wrap the shift count 28 if it exceeds the bit size of the type. 29 30**Contributors**: @cuviper, @edmccard, @meltinglava 31 32[79]: https://github.com/rust-num/num-traits/pull/79 33[81]: https://github.com/rust-num/num-traits/pull/81 34 35# Release 0.2.5 (2018-06-20) 36 37- [Documentation for `mul_add` now clarifies that it's not always faster.][70] 38- [The default methods in `FromPrimitive` and `ToPrimitive` are more robust.][73] 39 40**Contributors**: @cuviper, @frewsxcv 41 42[70]: https://github.com/rust-num/num-traits/pull/70 43[73]: https://github.com/rust-num/num-traits/pull/73 44 45# Release 0.2.4 (2018-05-11) 46 47- [Support for 128-bit integers is now automatically detected and enabled.][69] 48 Setting the `i128` crate feature now causes the build script to panic if such 49 support is not detected. 50 51**Contributors**: @cuviper 52 53[69]: https://github.com/rust-num/num-traits/pull/69 54 55# Release 0.2.3 (2018-05-10) 56 57- [The new `CheckedNeg` and `CheckedRem` traits][63] perform checked `Neg` and 58 `Rem`, returning `Some(output)` or `None` on overflow. 59- [The `no_std` implementation of `FloatCore::to_degrees` for `f32`][61] now 60 uses a constant for greater accuracy, mirroring [rust#47919]. (With `std` it 61 just calls the inherent `f32::to_degrees` in the standard library.) 62- [The new `MulAdd` and `MulAddAssign` traits][59] perform a fused multiply- 63 add. For integer types this is just a convenience, but for floating point 64 types this produces a more accurate result than the separate operations. 65- [All applicable traits are now implemented for 128-bit integers][60] starting 66 with Rust 1.26, enabled by the new `i128` crate feature. The `FromPrimitive` 67 and `ToPrimitive` traits now also have corresponding 128-bit methods, which 68 default to converting via 64-bit integers for compatibility. 69 70**Contributors**: @cuviper, @LEXUGE, @regexident, @vks 71 72[59]: https://github.com/rust-num/num-traits/pull/59 73[60]: https://github.com/rust-num/num-traits/pull/60 74[61]: https://github.com/rust-num/num-traits/pull/61 75[63]: https://github.com/rust-num/num-traits/pull/63 76[rust#47919]: https://github.com/rust-lang/rust/pull/47919 77 78# Release 0.2.2 (2018-03-18) 79 80- [Casting from floating point to integers now returns `None` on overflow][52], 81 avoiding [rustc's undefined behavior][rust-10184]. This applies to the `cast` 82 function and the traits `NumCast`, `FromPrimitive`, and `ToPrimitive`. 83 84**Contributors**: @apopiak, @cuviper, @dbarella 85 86[52]: https://github.com/rust-num/num-traits/pull/52 87[rust-10184]: https://github.com/rust-lang/rust/issues/10184 88 89 90# Release 0.2.1 (2018-03-01) 91 92- [The new `FloatCore` trait][32] offers a subset of `Float` for `#![no_std]` use. 93 [This includes everything][41] except the transcendental functions and FMA. 94- [The new `Inv` trait][37] returns the multiplicative inverse, or reciprocal. 95- [The new `Pow` trait][37] performs exponentiation, much like the existing `pow` 96 function, but with generic exponent types. 97- [The new `One::is_one` method][39] tests if a value equals 1. Implementers 98 should override this method if there's a more efficient way to check for 1, 99 rather than comparing with a temporary `one()`. 100 101**Contributors**: @clarcharr, @cuviper, @vks 102 103[32]: https://github.com/rust-num/num-traits/pull/32 104[37]: https://github.com/rust-num/num-traits/pull/37 105[39]: https://github.com/rust-num/num-traits/pull/39 106[41]: https://github.com/rust-num/num-traits/pull/41 107 108 109# Release 0.2.0 (2018-02-06) 110 111- **breaking change**: [There is now a `std` feature][30], enabled by default, along 112 with the implication that building *without* this feature makes this a 113 `#![no_std]` crate. 114 - The `Float` and `Real` traits are only available when `std` is enabled. 115 - Otherwise, the API is unchanged, and num-traits 0.1.43 now re-exports its 116 items from num-traits 0.2 for compatibility (the [semver-trick]). 117 118**Contributors**: @cuviper, @termoshtt, @vks 119 120[semver-trick]: https://github.com/dtolnay/semver-trick 121[30]: https://github.com/rust-num/num-traits/pull/30 122 123 124# Release 0.1.43 (2018-02-06) 125 126- All items are now [re-exported from num-traits 0.2][31] for compatibility. 127 128[31]: https://github.com/rust-num/num-traits/pull/31 129 130 131# Release 0.1.42 (2018-01-22) 132 133- [num-traits now has its own source repository][num-356] at [rust-num/num-traits][home]. 134- [`ParseFloatError` now implements `Display`][22]. 135- [The new `AsPrimitive` trait][17] implements generic casting with the `as` operator. 136- [The new `CheckedShl` and `CheckedShr` traits][21] implement generic 137 support for the `checked_shl` and `checked_shr` methods on primitive integers. 138- [The new `Real` trait][23] offers a subset of `Float` functionality that may be applicable to more 139 types, with a blanket implementation for all existing `T: Float` types. 140 141Thanks to @cuviper, @Enet4, @fabianschuiki, @svartalf, and @yoanlcq for their contributions! 142 143[home]: https://github.com/rust-num/num-traits 144[num-356]: https://github.com/rust-num/num/pull/356 145[17]: https://github.com/rust-num/num-traits/pull/17 146[21]: https://github.com/rust-num/num-traits/pull/21 147[22]: https://github.com/rust-num/num-traits/pull/22 148[23]: https://github.com/rust-num/num-traits/pull/23 149 150 151# Prior releases 152 153No prior release notes were kept. Thanks all the same to the many 154contributors that have made this crate what it is! 155