rust/library/core/src/num
bors 677b517e66 Auto merge of #87921 - kellerkindt:master, r=kennytm
Add Saturating type (based on Wrapping type)

Tracking #87920

### Unresolved Questions
<!--
Include any open questions that need to be answered before the feature can be
stabilised.
-->

 - [x] ~`impl Div for Saturating<T>` falls back on inner integer division - which seems alright?~
    - [x] add `saturating_div`? (to respect division by `-1`)
 - [x] There is no `::saturating_shl` and `::saturating_shr`. (How to) implement `Shl`, `ShlAssign`, `Shr` and `ShrAssign`?
   - [naively](3f7d2ce28f8cf4dec56bf65fa2e6da0cf329ec55)
 - [x] ~`saturating_neg` is only implemented on [signed integer types](https://doc.rust-lang.org/std/?search=saturating_n)~
 - [x] Is the implementation copied over from the `Wrapping`-type correct for `Saturating`?
   - [x] `Saturating::rotate_left`
   - [x] `Saturating::rotate_right`
   - [x] `Not`
   - [x] `BitXorOr` and `BitXorOrAssign`
   - [x] `BitOr` and `BitOrAssign`
   - [x] `BitAnd` and `BitAndAssign`
   - [x] `Saturating::swap_bytes`
   - [x] `Saturating::reverse_bits`
2021-08-28 23:39:02 +00:00
..
dec2flt Use if-let guards in the codebase 2021-08-25 20:24:35 +02:00
flt2dec Changed dec2flt to use the Eisel-Lemire algorithm. 2021-07-17 00:30:34 -05:00
shells Convert the rest of the standard library primitives to intra-doc links 2021-02-25 20:32:49 -05:00
bignum.rs [clippy] remove redundant field names 2021-05-02 20:24:17 -04:00
diy_float.rs Fix assert in diy_float 2021-07-27 16:02:35 -04:00
error.rs postpone stabilizaton by one release 2021-06-22 10:20:56 +01:00
f32.rs Intra doc link-ify a reference to a function 2021-06-01 05:04:48 +02:00
f64.rs Intra doc link-ify a reference to a function 2021-06-01 05:04:48 +02:00
fmt.rs Move flt2dec::{Formatted, Part} to dedicated module 2021-06-06 02:54:51 +01:00
int_log10.rs special case for integer log10 2021-07-07 14:10:05 +02:00
int_macros.rs Simplify saturating_div 2021-08-19 11:28:33 +02:00
mod.rs Add Saturating type (based on Wrapping type) 2021-08-10 19:27:01 +02:00
nonzero.rs Stop relying on #[feature(try_trait)] in doctests. 2021-06-12 10:58:37 +02:00
saturating.rs Unimpl Shl{Assign} for signed Saturating types until the correct impl is clear 2021-08-28 13:39:09 +02:00
uint_macros.rs Add saturating_div to unsigned integer types 2021-08-19 11:07:34 +02:00
wrapping.rs add BITS associated constant to core::num::Wrapping 2021-05-11 13:36:43 +02:00