use intra-doc links for tuples
This commit is contained in:
parent
305a9708ca
commit
e66f6e05a5
|
@ -1396,8 +1396,6 @@ assert_eq!(OneIntBit::from_num(0.5).overflowing_signum(), (OneIntBit::from_num(-
|
|||
assert_eq!(ZeroIntBits::from_num(0.25).overflowing_signum(), (ZeroIntBits::from_num(0), true));
|
||||
assert_eq!(ZeroIntBits::from_num(-0.5).overflowing_signum(), (ZeroIntBits::from_num(0), true));
|
||||
```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_signum(self) -> ($Fixed<Frac>, bool) {
|
||||
|
@ -1425,8 +1423,6 @@ assert_eq!(Fix::from_num(3).overflowing_mul(Fix::from_num(2)), (Fix::from_num(6)
|
|||
let wrapped = Fix::from_bits(!0 << 2);
|
||||
assert_eq!(Fix::MAX.overflowing_mul(Fix::from_num(4)), (wrapped, true));
|
||||
```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_mul(self, rhs: $Fixed<Frac>) -> ($Fixed<Frac>, bool) {
|
||||
|
@ -1456,8 +1452,6 @@ let quarter = Fix::from_num(1) / 4;
|
|||
let wrapped = Fix::from_bits(!0 << 2);
|
||||
assert_eq!(Fix::MAX.overflowing_div(quarter), (wrapped, true));
|
||||
```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_div(self, rhs: $Fixed<Frac>) -> ($Fixed<Frac>, bool) {
|
||||
|
@ -1489,8 +1483,6 @@ type Small = ", $s_fixed, "<U", $s_nbits_m1, ">;
|
|||
assert_eq!(Fix::from_num(0.25).overflowing_recip(), (Fix::from_num(4), false));
|
||||
assert_eq!(Small::from_num(0.25).overflowing_recip(), (Small::from_num(0), true));
|
||||
```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_recip(self) -> ($Fixed<Frac>, bool) {
|
||||
|
@ -1547,8 +1539,6 @@ assert_eq!(Fix::from_num(7.5).overflowing_div_euclid(Fix::from_num(2)), (check,
|
|||
let wrapped = Fix::MAX.wrapping_mul_int(4).round_to_zero();
|
||||
assert_eq!(Fix::MAX.overflowing_div_euclid(Fix::from_num(0.25)), (wrapped, true));
|
||||
```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_div_euclid(self, rhs: $Fixed<Frac>) -> ($Fixed<Frac>, bool) {
|
||||
|
@ -1609,8 +1599,6 @@ assert_eq!(Fix::MIN.overflowing_div_euclid_int(-1), (wrapped, true));
|
|||
",
|
||||
},
|
||||
"```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_div_euclid_int(self, rhs: $Inner) -> ($Fixed<Frac>, bool) {
|
||||
|
@ -1673,8 +1661,6 @@ assert_eq!(Fix::from_num(-7.5).overflowing_rem_euclid_int(20), (Fix::from_num(-3
|
|||
",
|
||||
},
|
||||
"```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_rem_euclid_int(self, rhs: $Inner) -> ($Fixed<Frac>, bool) {
|
||||
|
|
|
@ -742,7 +742,6 @@ assert_eq!(Fix::overflowing_from_num(large), (wrapped, true));
|
|||
[`bf16`]: `half::bf16`
|
||||
[`f16`]: `half::f16`
|
||||
[finite]: `f64::is_finite`
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_from_num<Src: ToFixed>(src: Src) -> ($Fixed<Frac>, bool) {
|
||||
|
@ -813,7 +812,6 @@ assert_eq!(one_point_625.overflowing_to_num::<f32>(), (1.625f32, false));
|
|||
|
||||
[`bf16`]: `half::bf16`
|
||||
[`f16`]: `half::f16`
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_to_num<Dst: FromFixed>(self) -> (Dst, bool) {
|
||||
|
@ -1175,8 +1173,6 @@ assert_eq!(U8F8::overflowing_from_str(\"9999.5\"), Ok((U8F8::from_num(15.5), tru
|
|||
",
|
||||
},
|
||||
"```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_from_str(
|
||||
|
@ -1213,8 +1209,6 @@ assert_eq!(U8F8::overflowing_from_str_binary(\"101100111000.1\"), Ok((check, tru
|
|||
",
|
||||
},
|
||||
"```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_from_str_binary(
|
||||
|
@ -1251,8 +1245,6 @@ assert_eq!(U8F8::overflowing_from_str_octal(\"7165.4\"), Ok((check, true)));
|
|||
",
|
||||
},
|
||||
"```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_from_str_octal(
|
||||
|
@ -1289,8 +1281,6 @@ assert_eq!(U8F8::overflowing_from_str_hex(\"C0F.FE\"), Ok((check, true)));
|
|||
",
|
||||
},
|
||||
"```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_from_str_hex(
|
||||
|
|
|
@ -2260,8 +2260,6 @@ assert_eq!(Fix::from_num(5).overflowing_neg(), (Fix::from_bits(neg_five_bits), t
|
|||
},
|
||||
"
|
||||
```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub const fn overflowing_neg(self) -> ($Fixed<Frac>, bool) {
|
||||
|
@ -2288,8 +2286,6 @@ assert_eq!(Fix::MAX.overflowing_add(one), (",
|
|||
if_signed_else_empty_str! { $Signedness, "Fix::MIN + " },
|
||||
"one_minus_bit, true));
|
||||
```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub const fn overflowing_add(self, rhs: $Fixed<Frac>) -> ($Fixed<Frac>, bool) {
|
||||
|
@ -2321,8 +2317,6 @@ assert_eq!(Fix::from_num(0)",
|
|||
},
|
||||
".overflowing_sub(one), (Fix::MAX - one_minus_bit, true));
|
||||
```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub const fn overflowing_sub(self, rhs: $Fixed<Frac>) -> ($Fixed<Frac>, bool) {
|
||||
|
@ -2369,8 +2363,6 @@ assert_eq!(
|
|||
"
|
||||
},
|
||||
"```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_mul_add<MulFrac: $LeEqU>(
|
||||
|
@ -2402,8 +2394,6 @@ assert_eq!(Fix::from_num(3).overflowing_mul_int(2), (Fix::from_num(6), false));
|
|||
let wrapped = Fix::from_bits(!0 << 2);
|
||||
assert_eq!(Fix::MAX.overflowing_mul_int(4), (wrapped, true));
|
||||
```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub const fn overflowing_mul_int(self, rhs: $Inner) -> ($Fixed<Frac>, bool) {
|
||||
|
@ -2444,8 +2434,6 @@ assert_eq!(Fix::from_num(3).overflowing_div_int(2), (one_point_5, false));
|
|||
",
|
||||
},
|
||||
"```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_div_int(self, rhs: $Inner) -> ($Fixed<Frac>, bool) {
|
||||
|
@ -2469,8 +2457,6 @@ type Fix = ", $s_fixed, "<U4>;
|
|||
assert_eq!((Fix::from_num(1) / 2).overflowing_shl(3), (Fix::from_num(4), false));
|
||||
assert_eq!((Fix::from_num(1) / 2).overflowing_shl(3 + ", $s_nbits, "), (Fix::from_num(4), true));
|
||||
```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub const fn overflowing_shl(self, rhs: u32) -> ($Fixed<Frac>, bool) {
|
||||
|
@ -2494,8 +2480,6 @@ type Fix = ", $s_fixed, "<U4>;
|
|||
assert_eq!((Fix::from_num(4)).overflowing_shr(3), (Fix::from_num(1) / 2, false));
|
||||
assert_eq!((Fix::from_num(4)).overflowing_shr(3 + ", $s_nbits, "), (Fix::from_num(1) / 2, true));
|
||||
```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub const fn overflowing_shr(self, rhs: u32) -> ($Fixed<Frac>, bool) {
|
||||
|
@ -2523,8 +2507,6 @@ type Fix = ", $s_fixed, "<U4>;
|
|||
assert_eq!(Fix::from_num(-5).overflowing_abs(), (Fix::from_num(5), false));
|
||||
assert_eq!(Fix::MIN.overflowing_abs(), (Fix::MIN, true));
|
||||
```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub const fn overflowing_abs(self) -> ($Fixed<Frac>, bool) {
|
||||
|
|
|
@ -835,8 +835,6 @@ assert_eq!(Fix::from_num(2.5).overflowing_ceil(), (Fix::from_num(3), false));
|
|||
},
|
||||
"assert_eq!(Fix::MAX.overflowing_ceil(), (Fix::MIN, true));
|
||||
```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_ceil(self) -> ($Fixed<Frac>, bool) {
|
||||
|
@ -899,8 +897,6 @@ assert_eq!(AllFrac::MIN.overflowing_floor(), (AllFrac::from_num(0), true));
|
|||
",
|
||||
},
|
||||
"```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_floor(self) -> ($Fixed<Frac>, bool) {
|
||||
|
@ -937,8 +933,6 @@ assert_eq!(Fix::from_num(2.5).overflowing_round(), (Fix::from_num(3), false));
|
|||
},
|
||||
"assert_eq!(Fix::MAX.overflowing_round(), (Fix::MIN, true));
|
||||
```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_round(self) -> ($Fixed<Frac>, bool) {
|
||||
|
@ -995,8 +989,6 @@ assert_eq!(Fix::from_num(2.5).overflowing_round_ties_to_even(), (Fix::from_num(2
|
|||
assert_eq!(Fix::from_num(3.5).overflowing_round_ties_to_even(), (Fix::from_num(4), false));
|
||||
assert_eq!(Fix::MAX.overflowing_round_ties_to_even(), (Fix::MIN, true));
|
||||
```
|
||||
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
pub fn overflowing_round_ties_to_even(self) -> ($Fixed<Frac>, bool) {
|
||||
|
|
|
@ -510,8 +510,6 @@ where
|
|||
/// wrapped value is returned.
|
||||
///
|
||||
/// Rounding is to the nearest, with ties rounded to even.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_from_str(src: &str) -> Result<(Self, bool), ParseFixedError>;
|
||||
|
||||
/// Parses a string slice containing binary digits to return a
|
||||
|
@ -522,8 +520,6 @@ where
|
|||
/// wrapped value is returned.
|
||||
///
|
||||
/// Rounding is to the nearest, with ties rounded to even.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_from_str_binary(src: &str) -> Result<(Self, bool), ParseFixedError>;
|
||||
|
||||
/// Parses a string slice containing octal digits to return a
|
||||
|
@ -534,8 +530,6 @@ where
|
|||
/// wrapped value is returned.
|
||||
///
|
||||
/// Rounding is to the nearest, with ties rounded to even.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_from_str_octal(src: &str) -> Result<(Self, bool), ParseFixedError>;
|
||||
|
||||
/// Parses a string slice containing hexadecimal digits to return a
|
||||
|
@ -546,8 +540,6 @@ where
|
|||
/// wrapped value is returned.
|
||||
///
|
||||
/// Rounding is to the nearest, with ties rounded to even.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_from_str_hex(src: &str) -> Result<(Self, bool), ParseFixedError>;
|
||||
|
||||
/// Returns the integer part.
|
||||
|
@ -660,8 +652,6 @@ where
|
|||
/// Returns a [tuple] of the fixed-point number and a [`bool`],
|
||||
/// indicating whether an overflow has occurred. On overflow, the
|
||||
/// wrapped value is returned.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_ceil(self) -> (Self, bool);
|
||||
|
||||
/// Overflowing floor. Rounds to the next integer towards −∞.
|
||||
|
@ -669,8 +659,6 @@ where
|
|||
/// Returns a [tuple] of the fixed-point number and a [`bool`],
|
||||
/// indicating whether an overflow has occurred. On overflow, the
|
||||
/// wrapped value is returned.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_floor(self) -> (Self, bool);
|
||||
|
||||
/// Overflowing round. Rounds to the next integer to the nearest,
|
||||
|
@ -679,8 +667,6 @@ where
|
|||
/// Returns a [tuple] of the fixed-point number and a [`bool`],
|
||||
/// indicating whether an overflow has occurred. On overflow, the
|
||||
/// wrapped value is returned.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_round(self) -> (Self, bool);
|
||||
|
||||
/// Overflowing round. Rounds to the next integer to the nearest,
|
||||
|
@ -689,8 +675,6 @@ where
|
|||
/// Returns a [tuple] of the fixed-point number and a [`bool`],
|
||||
/// indicating whether an overflow has occurred. On overflow, the
|
||||
/// wrapped value is returned.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_round_ties_to_even(self) -> (Self, bool);
|
||||
|
||||
/// Returns the number of ones in the binary representation.
|
||||
|
@ -1120,8 +1104,6 @@ where
|
|||
/// Returns a [tuple] of the negated value and a [`bool`],
|
||||
/// indicating whether an overflow has occurred. On overflow, the
|
||||
/// wrapped value is returned.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_neg(self) -> (Self, bool);
|
||||
|
||||
/// Overflowing addition.
|
||||
|
@ -1129,8 +1111,6 @@ where
|
|||
/// Returns a [tuple] of the sum and a [`bool`], indicating whether
|
||||
/// an overflow has occurred. On overflow, the wrapped value is
|
||||
/// returned.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_add(self, rhs: Self) -> (Self, bool);
|
||||
|
||||
/// Overflowing subtraction.
|
||||
|
@ -1138,8 +1118,6 @@ where
|
|||
/// Returns a [tuple] of the difference and a [`bool`], indicating
|
||||
/// whether an overflow has occurred. On overflow, the wrapped
|
||||
/// value is returned.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_sub(self, rhs: Self) -> (Self, bool);
|
||||
|
||||
/// Overflowing multiplication.
|
||||
|
@ -1147,8 +1125,6 @@ where
|
|||
/// Returns a [tuple] of the product and a [`bool`], indicating
|
||||
/// whether an overflow has occurred. On overflow, the wrapped
|
||||
/// value is returned.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_mul(self, rhs: Self) -> (Self, bool);
|
||||
|
||||
/// Overflowing division.
|
||||
|
@ -1160,8 +1136,6 @@ where
|
|||
/// # Panics
|
||||
///
|
||||
/// Panics if the divisor is zero.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_div(self, rhs: Self) -> (Self, bool);
|
||||
|
||||
/// Overflowing reciprocal.
|
||||
|
@ -1173,8 +1147,6 @@ where
|
|||
/// # Panics
|
||||
///
|
||||
/// Panics if `self` is zero.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_recip(self) -> (Self, bool);
|
||||
|
||||
/// Overflowing multiply and add.
|
||||
|
@ -1182,8 +1154,6 @@ where
|
|||
/// Returns a [tuple] of `self` × `mul` + `add` and a [`bool`],
|
||||
/// indicating whether an overflow has occurred. On overflow, the
|
||||
/// wrapped value is returned.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_mul_add(self, mul: Self, add: Self) -> (Self, bool);
|
||||
|
||||
/// Overflowing Euclidean division.
|
||||
|
@ -1195,8 +1165,6 @@ where
|
|||
/// # Panics
|
||||
///
|
||||
/// Panics if the divisor is zero.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_div_euclid(self, rhs: Self) -> (Self, bool);
|
||||
|
||||
/// Overflowing multiplication by an integer.
|
||||
|
@ -1204,8 +1172,6 @@ where
|
|||
/// Returns a [tuple] of the product and a [`bool`], indicating
|
||||
/// whether an overflow has occurred. On overflow, the wrapped
|
||||
/// value is returned.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_mul_int(self, rhs: Self::Bits) -> (Self, bool);
|
||||
|
||||
/// Overflowing division by an integer.
|
||||
|
@ -1217,8 +1183,6 @@ where
|
|||
/// # Panics
|
||||
///
|
||||
/// Panics if the divisor is zero.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_div_int(self, rhs: Self::Bits) -> (Self, bool);
|
||||
|
||||
/// Overflowing Euclidean division by an integer.
|
||||
|
@ -1230,8 +1194,6 @@ where
|
|||
/// # Panics
|
||||
///
|
||||
/// Panics if the divisor is zero.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_div_euclid_int(self, rhs: Self::Bits) -> (Self, bool);
|
||||
|
||||
/// Overflowing remainder for Euclidean division by an integer.
|
||||
|
@ -1243,8 +1205,6 @@ where
|
|||
/// # Panics
|
||||
///
|
||||
/// Panics if the divisor is zero.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_rem_euclid_int(self, rhs: Self::Bits) -> (Self, bool);
|
||||
|
||||
/// Overflowing shift left.
|
||||
|
@ -1252,8 +1212,6 @@ where
|
|||
/// Returns a [tuple] of the shifted value and a [`bool`],
|
||||
/// indicating whether an overflow has occurred. On overflow, the
|
||||
/// wrapped value is returned.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_shl(self, rhs: u32) -> (Self, bool);
|
||||
|
||||
/// Overflowing shift right.
|
||||
|
@ -1261,8 +1219,6 @@ where
|
|||
/// Returns a [tuple] of the shifted value and a [`bool`],
|
||||
/// indicating whether an overflow has occurred. On overflow, the
|
||||
/// wrapped value is returned.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_shr(self, rhs: u32) -> (Self, bool);
|
||||
}
|
||||
|
||||
|
@ -1387,8 +1343,6 @@ pub trait FixedSigned: Fixed + Neg<Output = Self> {
|
|||
/// Returns a [tuple] of the fixed-point number and a [`bool`],
|
||||
/// indicating whether an overflow has occurred. On overflow, the
|
||||
/// wrapped value is returned.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_abs(self) -> (Self, bool);
|
||||
|
||||
/// Overflowing signum.
|
||||
|
@ -1402,8 +1356,6 @@ pub trait FixedSigned: Fixed + Neg<Output = Self> {
|
|||
/// or one integer bits such that it cannot hold the value 1.
|
||||
/// * if the value is negative and the fixed-point number has zero
|
||||
/// integer bits, such that it cannot hold the value −1.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_signum(self) -> (Self, bool);
|
||||
}
|
||||
|
||||
|
@ -1620,8 +1572,6 @@ pub trait FromFixed {
|
|||
/// returned.
|
||||
///
|
||||
/// Any extra fractional bits are discarded, which rounds towards −∞.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_from_fixed<F: Fixed>(src: F) -> (Self, bool)
|
||||
where
|
||||
Self: Sized;
|
||||
|
@ -1730,7 +1680,6 @@ pub trait ToFixed {
|
|||
/// Panics if `self` is a floating-point number that is not [finite].
|
||||
///
|
||||
/// [finite]: `f64::is_finite`
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
fn overflowing_to_fixed<F: Fixed>(self) -> (F, bool);
|
||||
|
||||
/// Converts to a fixed-point number, panicking if it does not fit.
|
||||
|
@ -1797,8 +1746,6 @@ impl ToFixed for bool {
|
|||
/// Returns a [tuple] of the fixed-point number and a [`bool`]
|
||||
/// indicating whether an overflow has occurred. On overflow, the
|
||||
/// wrapped value is returned.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
#[inline]
|
||||
fn overflowing_to_fixed<F: Fixed>(self) -> (F, bool) {
|
||||
ToFixed::overflowing_to_fixed(self as u8)
|
||||
|
@ -1871,8 +1818,6 @@ macro_rules! impl_int {
|
|||
/// returned.
|
||||
///
|
||||
/// Any fractional bits are discarded, which rounds towards −∞.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
#[inline]
|
||||
fn overflowing_from_fixed<F: Fixed>(src: F) -> (Self, bool) {
|
||||
let (repr_fixed, overflow) = FromFixed::overflowing_from_fixed(src);
|
||||
|
@ -1934,8 +1879,6 @@ macro_rules! impl_int {
|
|||
/// Returns a [tuple] of the fixed-point number and a [`bool`]
|
||||
/// indicating whether an overflow has occurred. On overflow, the
|
||||
/// wrapped value is returned.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
#[inline]
|
||||
fn overflowing_to_fixed<F: Fixed>(self) -> (F, bool) {
|
||||
ToFixed::overflowing_to_fixed(self.to_repr_fixed())
|
||||
|
@ -2025,8 +1968,6 @@ macro_rules! impl_float {
|
|||
/// overflow, the wrapped value is returned.
|
||||
///
|
||||
/// Rounding is to the nearest, with ties rounded to even.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
#[inline]
|
||||
fn overflowing_from_fixed<F: Fixed>(src: F) -> (Self, bool) {
|
||||
(FromFixed::from_fixed(src), false)
|
||||
|
@ -2146,7 +2087,6 @@ Rounding is to the nearest, with ties rounded to even.
|
|||
Panics if `self` is not [finite].
|
||||
|
||||
[finite]: `", $link, "::is_finite`
|
||||
[tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
";
|
||||
#[inline]
|
||||
#[track_caller]
|
||||
|
@ -2492,8 +2432,6 @@ macro_rules! impl_fixed {
|
|||
/// overflow, the wrapped value is returned.
|
||||
///
|
||||
/// Any extra fractional bits are discarded, which rounds towards −∞.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
#[inline]
|
||||
fn overflowing_from_fixed<F: Fixed>(src: F) -> (Self, bool) {
|
||||
let conv = src.private_to_fixed_helper(Self::FRAC_NBITS, Self::INT_NBITS);
|
||||
|
@ -2588,8 +2526,6 @@ macro_rules! impl_fixed {
|
|||
/// overflow, the wrapped value is returned.
|
||||
///
|
||||
/// Any extra fractional bits are discarded, which rounds towards −∞.
|
||||
///
|
||||
/// [tuple]: https://doc.rust-lang.org/nightly/std/primitive.tuple.html
|
||||
#[inline]
|
||||
fn overflowing_to_fixed<F: Fixed>(self) -> (F, bool) {
|
||||
FromFixed::overflowing_from_fixed(self)
|
||||
|
|
Loading…
Reference in New Issue