rust/library/core/src/num
Matthias Krüger ba3e535c07
Rollup merge of #112644 - zica87:nonZeroTypes, r=Mark-Simulacrum
Correct types in method descriptions of `NonZero*` types

- `$Int`: e.g. i32, usize
- `$Ty`: e.g. NonZeroI32, NonZeroUsize

|method|current description|after my changes|
|-|-|-|
|`saturating_add`|...Return `$Int`::MAX on overflow.|...Return `$Ty`::MAX on overflow.|
|`checked_abs`|...returns None if self == `$Int`::MIN.|...returns None if self == `$Ty`::MIN.|
|`checked_neg`|...returning None if self == i32::MIN.|...returning None if self == `$Ty`::MIN.|
|`saturating_neg`|...returning MAX if self == i32::MIN...|...returning `$Ty`::MAX if self == `$Ty`::MIN...|
|`saturating_mul`|...Return `$Int`::MAX...|...Return `$Ty`::MAX...|
|`saturating_pow`|...Return `$Int`::MIN or `$Int`::MAX...|...Return `$Ty`::MIN or `$Ty`::MAX...|

---

For example:

```rust
pub const fn saturating_neg(self) -> NonZeroI128
```

- current
  - Saturating negation. Computes `-self`, returning `MAX` if `self == i32::MIN` instead of overflowing.
- after my changes
  - Saturating negation. Computes `-self`, returning `NonZeroI128::MAX` if `self == NonZeroI128::MIN` instead of overflowing.
2023-06-17 12:43:30 +02:00
..
dec2flt Improve the floating point parser in dec2flt. 2023-04-10 00:47:08 +02:00
flt2dec Add shortcut for Grisu3 algorithm. 2023-04-25 11:34:57 +08:00
shells Fix wrong type in docs: i16 -> u16 2023-04-07 23:49:20 +02:00
bignum.rs Rename integer log* methods to ilog* 2022-08-09 10:20:49 -07:00
diy_float.rs Fix assert in diy_float 2021-07-27 16:02:35 -04:00
error.rs Add #[inline] to functions that are never called 2023-05-07 12:41:37 +01:00
f32.rs Add diagnostic items for f32::NAN and f64::NAN 2023-06-09 17:46:33 +02:00
f64.rs Add diagnostic items for f32::NAN and f64::NAN 2023-06-09 17:46:33 +02:00
fmt.rs Fix a bunch of typos 2021-12-14 16:40:43 +01:00
int_log10.rs Have a function for the log(0) panic, rather than copy-pasting the string constant 2023-02-10 12:50:17 -08:00
int_macros.rs Implement midpoint for all signed and unsigned integers 2023-04-26 10:18:53 +02:00
mod.rs Auto merge of #92048 - Urgau:num-midpoint, r=scottmcm 2023-05-14 19:33:02 +00:00
nonzero.rs Correct types in method descriptions of NonZero* types 2023-06-15 11:41:56 +08:00
saturating.rs Unimpl {Add,Sub,Mul,Div,Rem,BitXor,BitOr,BitAnd}<$t> for Saturating<$t> 2022-01-26 23:49:54 +01:00
uint_macros.rs fix codegen difference 2023-04-17 09:27:07 +00:00
wrapping.rs rm const traits in libcore 2023-04-16 06:49:27 +00:00