DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (25c1ba3e39da)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
# Release 0.2.10 (2019-11-22)

- [Updated the `libm` dependency to 0.2][144].

**Contributors**: @CryZe

[144]: https://github.com/rust-num/num-traits/pull/144

# Release 0.2.9 (2019-11-12)

- [A new optional `libm` dependency][99] enables the `Float` and `Real` traits
  in `no_std` builds.
- [The new `clamp_min` and `clamp_max`][122] limit minimum and maximum values
  while preserving input `NAN`s.
- [Fixed a panic in floating point `from_str_radix` on invalid signs][126].
- Miscellaneous documentation updates.

**Contributors**: @cuviper, @dingelish, @HeroicKatora, @jturner314, @ocstl,
@Shnatsel, @termoshtt, @waywardmonkeys, @yoanlcq

[99]: https://github.com/rust-num/num-traits/pull/99
[122]: https://github.com/rust-num/num-traits/pull/122
[126]: https://github.com/rust-num/num-traits/pull/126

# Release 0.2.8 (2019-05-21)

- [Fixed feature detection on `no_std` targets][116].

**Contributors**: @cuviper

[116]: https://github.com/rust-num/num-traits/pull/116

# Release 0.2.7 (2019-05-20)

- [Documented when `CheckedShl` and `CheckedShr` return `None`][90].
- [The new `Zero::set_zero` and `One::set_one`][104] will set values to their
  identities in place, possibly optimized better than direct assignment.
- [Documented general features and intentions of `PrimInt`][108].

**Contributors**: @cuviper, @dvdhrm, @ignatenkobrain, @lcnr, @samueltardieu

[90]: https://github.com/rust-num/num-traits/pull/90
[104]: https://github.com/rust-num/num-traits/pull/104
[108]: https://github.com/rust-num/num-traits/pull/108

# Release 0.2.6 (2018-09-13)

- [Documented that `pow(0, 0)` returns `1`][79].  Mathematically, this is not
  strictly defined, but the current behavior is a pragmatic choice that has
  precedent in Rust `core` for the primitives and in many other languages.
- [The new `WrappingShl` and `WrappingShr` traits][81] will wrap the shift count
  if it exceeds the bit size of the type.

**Contributors**: @cuviper, @edmccard, @meltinglava

[79]: https://github.com/rust-num/num-traits/pull/79
[81]: https://github.com/rust-num/num-traits/pull/81

# Release 0.2.5 (2018-06-20)

- [Documentation for `mul_add` now clarifies that it's not always faster.][70]
- [The default methods in `FromPrimitive` and `ToPrimitive` are more robust.][73]

**Contributors**: @cuviper, @frewsxcv

[70]: https://github.com/rust-num/num-traits/pull/70
[73]: https://github.com/rust-num/num-traits/pull/73

# Release 0.2.4 (2018-05-11)

- [Support for 128-bit integers is now automatically detected and enabled.][69]
  Setting the `i128` crate feature now causes the build script to panic if such
  support is not detected.

**Contributors**: @cuviper

[69]: https://github.com/rust-num/num-traits/pull/69

# Release 0.2.3 (2018-05-10)

- [The new `CheckedNeg` and `CheckedRem` traits][63] perform checked `Neg` and
  `Rem`, returning `Some(output)` or `None` on overflow.
- [The `no_std` implementation of `FloatCore::to_degrees` for `f32`][61] now
  uses a constant for greater accuracy, mirroring [rust#47919].  (With `std` it
  just calls the inherent `f32::to_degrees` in the standard library.)
- [The new `MulAdd` and `MulAddAssign` traits][59] perform a fused multiply-
  add.  For integer types this is just a convenience, but for floating point
  types this produces a more accurate result than the separate operations.
- [All applicable traits are now implemented for 128-bit integers][60] starting
  with Rust 1.26, enabled by the new `i128` crate feature.  The `FromPrimitive`
  and `ToPrimitive` traits now also have corresponding 128-bit methods, which
  default to converting via 64-bit integers for compatibility.

**Contributors**: @cuviper, @LEXUGE, @regexident, @vks

[59]: https://github.com/rust-num/num-traits/pull/59
[60]: https://github.com/rust-num/num-traits/pull/60
[61]: https://github.com/rust-num/num-traits/pull/61
[63]: https://github.com/rust-num/num-traits/pull/63
[rust#47919]: https://github.com/rust-lang/rust/pull/47919

# Release 0.2.2 (2018-03-18)

- [Casting from floating point to integers now returns `None` on overflow][52],
  avoiding [rustc's undefined behavior][rust-10184]. This applies to the `cast`
  function and the traits `NumCast`, `FromPrimitive`, and `ToPrimitive`.

**Contributors**: @apopiak, @cuviper, @dbarella

[52]: https://github.com/rust-num/num-traits/pull/52
[rust-10184]: https://github.com/rust-lang/rust/issues/10184


# Release 0.2.1 (2018-03-01)

- [The new `FloatCore` trait][32] offers a subset of `Float` for `#![no_std]` use.
  [This includes everything][41] except the transcendental functions and FMA.
- [The new `Inv` trait][37] returns the multiplicative inverse, or reciprocal.
- [The new `Pow` trait][37] performs exponentiation, much like the existing `pow`
  function, but with generic exponent types.
- [The new `One::is_one` method][39] tests if a value equals 1.  Implementers
  should override this method if there's a more efficient way to check for 1,
  rather than comparing with a temporary `one()`.

**Contributors**: @clarcharr, @cuviper, @vks

[32]: https://github.com/rust-num/num-traits/pull/32
[37]: https://github.com/rust-num/num-traits/pull/37
[39]: https://github.com/rust-num/num-traits/pull/39
[41]: https://github.com/rust-num/num-traits/pull/41


# Release 0.2.0 (2018-02-06)

- **breaking change**: [There is now a `std` feature][30], enabled by default, along
  with the implication that building *without* this feature makes this a
  `#![no_std]` crate.
  - The `Float` and `Real` traits are only available when `std` is enabled.
  - Otherwise, the API is unchanged, and num-traits 0.1.43 now re-exports its
    items from num-traits 0.2 for compatibility (the [semver-trick]).

**Contributors**: @cuviper, @termoshtt, @vks

[semver-trick]: https://github.com/dtolnay/semver-trick
[30]: https://github.com/rust-num/num-traits/pull/30


# Release 0.1.43 (2018-02-06)

- All items are now [re-exported from num-traits 0.2][31] for compatibility.

[31]: https://github.com/rust-num/num-traits/pull/31


# Release 0.1.42 (2018-01-22)

- [num-traits now has its own source repository][num-356] at [rust-num/num-traits][home].
- [`ParseFloatError` now implements `Display`][22].
- [The new `AsPrimitive` trait][17] implements generic casting with the `as` operator.
- [The new `CheckedShl` and `CheckedShr` traits][21] implement generic
  support for the `checked_shl` and `checked_shr` methods on primitive integers.
- [The new `Real` trait][23] offers a subset of `Float` functionality that may be applicable to more
  types, with a blanket implementation for all existing `T: Float` types.

Thanks to @cuviper, @Enet4, @fabianschuiki, @svartalf, and @yoanlcq for their contributions!

[home]: https://github.com/rust-num/num-traits
[num-356]: https://github.com/rust-num/num/pull/356
[17]: https://github.com/rust-num/num-traits/pull/17
[21]: https://github.com/rust-num/num-traits/pull/21
[22]: https://github.com/rust-num/num-traits/pull/22
[23]: https://github.com/rust-num/num-traits/pull/23


# Prior releases

No prior release notes were kept.  Thanks all the same to the many
contributors that have made this crate what it is!