pub trait PrimitiveSigned:
PrimitiveInteger
+ From<i8>
+ Neg<Output = Self> {
type Unsigned: PrimitiveUnsigned;
Show 20 methods
// Required methods
fn abs(self) -> Self;
fn abs_diff(self, other: Self) -> Self::Unsigned;
fn checked_abs(self) -> Option<Self>;
fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>;
fn checked_isqrt(self) -> Option<Self>;
fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>;
fn is_negative(self) -> bool;
fn is_positive(self) -> bool;
fn overflowing_abs(self) -> (Self, bool);
fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool);
fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool);
fn saturating_abs(self) -> Self;
fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self;
fn saturating_neg(self) -> Self;
fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self;
fn signum(self) -> Self;
fn unsigned_abs(self) -> Self::Unsigned;
fn wrapping_abs(self) -> Self;
fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self;
fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self;
}Expand description
Trait for all primitive signed integer types, including the supertraits PrimitiveInteger
and PrimitiveNumber.
This encapsulates trait implementations and inherent methods that are common among all of the
primitive signed integer types: i8, i16, i32, i64, i128, and isize.
See the corresponding items on the individual types for more documentation and examples.
This trait is sealed with a private trait to prevent downstream implementations, so we may continue to expand along with the standard library without worrying about breaking changes for implementors.
§Examples
use num_primitive::PrimitiveSigned;
// GCD with Bézout coefficients (extended Euclidean algorithm)
fn extended_gcd<T: PrimitiveSigned>(a: T, b: T) -> (T, T, T) {
let zero = T::from(0i8);
let one = T::from(1i8);
let (mut old_r, mut r) = (a, b);
let (mut old_s, mut s) = (one, zero);
let (mut old_t, mut t) = (zero, one);
while r != zero {
let quotient = old_r.div_euclid(r);
(old_r, r) = (r, old_r - quotient * r);
(old_s, s) = (s, old_s - quotient * s);
(old_t, t) = (t, old_t - quotient * t);
}
let (gcd, x, y) = if old_r.is_negative() {
(-old_r, -old_s, -old_t)
} else {
(old_r, old_s, old_t)
};
assert_eq!(gcd, a * x + b * y);
(gcd, x, y)
}
assert_eq!(extended_gcd::<i8>(0, -42), (42, 0, -1));
assert_eq!(extended_gcd::<i8>(48, 18), (6, -1, 3));
assert_eq!(extended_gcd::<i16>(1071, -462), (21, -3, -7));
assert_eq!(extended_gcd::<i64>(6_700_417, 2_147_483_647), (1, 715_828_096, -2_233_473));Required Associated Types§
Sourcetype Unsigned: PrimitiveUnsigned
type Unsigned: PrimitiveUnsigned
The unsigned integer type used by methods like abs_diff and
checked_add_unsigned.
Required Methods§
Sourcefn abs_diff(self, other: Self) -> Self::Unsigned
fn abs_diff(self, other: Self) -> Self::Unsigned
Computes the absolute difference between self and other.
Sourcefn checked_abs(self) -> Option<Self>
fn checked_abs(self) -> Option<Self>
Checked absolute value. Computes self.abs(), returning None if self == MIN.
Sourcefn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
Checked addition with an unsigned integer. Computes self + rhs, returning None if
overflow occurred.
Sourcefn checked_isqrt(self) -> Option<Self>
fn checked_isqrt(self) -> Option<Self>
Returns the square root of the number, rounded down. Returns None if self is negative.
Sourcefn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
Checked subtraction with an unsigned integer. Computes self - rhs, returning None if
overflow occurred.
Sourcefn is_negative(self) -> bool
fn is_negative(self) -> bool
Returns true if self is negative and false if the number is zero or positive.
Sourcefn is_positive(self) -> bool
fn is_positive(self) -> bool
Returns true if self is positive and false if the number is zero or negative.
Sourcefn overflowing_abs(self) -> (Self, bool)
fn overflowing_abs(self) -> (Self, bool)
Computes the absolute value of self. Returns a tuple of the absolute version of self
along with a boolean indicating whether an overflow happened.
Sourcefn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
Calculates self + rhs with an unsigned rhs. Returns a tuple of the addition along with
a boolean indicating whether an arithmetic overflow would occur.
Sourcefn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
Calculates self - rhs with an unsigned rhs. Returns a tuple of the subtraction along
with a boolean indicating whether an arithmetic overflow would occur.
Sourcefn saturating_abs(self) -> Self
fn saturating_abs(self) -> Self
Saturating absolute value. Computes self.abs(), returning MAX if self == MIN instead
of overflowing.
Sourcefn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self
fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self
Saturating addition with an unsigned integer. Computes self + rhs, saturating at the
numeric bounds instead of overflowing.
Sourcefn saturating_neg(self) -> Self
fn saturating_neg(self) -> Self
Saturating integer negation. Computes -self, returning MAX if self == MIN instead of
overflowing.
Sourcefn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self
fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self
Saturating subtraction with an unsigned integer. Computes self - rhs, saturating at the
numeric bounds instead of overflowing.
Sourcefn unsigned_abs(self) -> Self::Unsigned
fn unsigned_abs(self) -> Self::Unsigned
Computes the absolute value of self without any wrapping or panicking.
Sourcefn wrapping_abs(self) -> Self
fn wrapping_abs(self) -> Self
Wrapping (modular) absolute value. Computes self.abs(), wrapping around at the boundary
of the type.
Sourcefn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self
fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self
Wrapping (modular) addition with an unsigned integer. Computes self + rhs, wrapping
around at the boundary of the type.
Sourcefn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self
fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self
Wrapping (modular) subtraction with an unsigned integer. Computes self - rhs, wrapping
around at the boundary of the type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl PrimitiveSigned for i8
impl PrimitiveSigned for i8
Source§fn checked_abs(self) -> Option<Self>
fn checked_abs(self) -> Option<Self>
See the inherent checked_abs method.
Source§fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
See the inherent checked_add_unsigned method.
Source§fn checked_isqrt(self) -> Option<Self>
fn checked_isqrt(self) -> Option<Self>
See the inherent checked_isqrt method.
Source§fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
See the inherent checked_sub_unsigned method.
Source§fn is_negative(self) -> bool
fn is_negative(self) -> bool
See the inherent is_negative method.
Source§fn is_positive(self) -> bool
fn is_positive(self) -> bool
See the inherent is_positive method.
Source§fn overflowing_abs(self) -> (Self, bool)
fn overflowing_abs(self) -> (Self, bool)
See the inherent overflowing_abs method.
Source§fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
See the inherent overflowing_add_unsigned method.
Source§fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
See the inherent overflowing_sub_unsigned method.
Source§fn saturating_abs(self) -> Self
fn saturating_abs(self) -> Self
See the inherent saturating_abs method.
Source§fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self
fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent saturating_add_unsigned method.
Source§fn saturating_neg(self) -> Self
fn saturating_neg(self) -> Self
See the inherent saturating_neg method.
Source§fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self
fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent saturating_sub_unsigned method.
Source§fn unsigned_abs(self) -> Self::Unsigned
fn unsigned_abs(self) -> Self::Unsigned
See the inherent unsigned_abs method.
Source§fn wrapping_abs(self) -> Self
fn wrapping_abs(self) -> Self
See the inherent wrapping_abs method.
Source§fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self
fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent wrapping_add_unsigned method.
Source§fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self
fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent wrapping_sub_unsigned method.
type Unsigned = u8
Source§impl PrimitiveSigned for i16
impl PrimitiveSigned for i16
Source§fn checked_abs(self) -> Option<Self>
fn checked_abs(self) -> Option<Self>
See the inherent checked_abs method.
Source§fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
See the inherent checked_add_unsigned method.
Source§fn checked_isqrt(self) -> Option<Self>
fn checked_isqrt(self) -> Option<Self>
See the inherent checked_isqrt method.
Source§fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
See the inherent checked_sub_unsigned method.
Source§fn is_negative(self) -> bool
fn is_negative(self) -> bool
See the inherent is_negative method.
Source§fn is_positive(self) -> bool
fn is_positive(self) -> bool
See the inherent is_positive method.
Source§fn overflowing_abs(self) -> (Self, bool)
fn overflowing_abs(self) -> (Self, bool)
See the inherent overflowing_abs method.
Source§fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
See the inherent overflowing_add_unsigned method.
Source§fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
See the inherent overflowing_sub_unsigned method.
Source§fn saturating_abs(self) -> Self
fn saturating_abs(self) -> Self
See the inherent saturating_abs method.
Source§fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self
fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent saturating_add_unsigned method.
Source§fn saturating_neg(self) -> Self
fn saturating_neg(self) -> Self
See the inherent saturating_neg method.
Source§fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self
fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent saturating_sub_unsigned method.
Source§fn unsigned_abs(self) -> Self::Unsigned
fn unsigned_abs(self) -> Self::Unsigned
See the inherent unsigned_abs method.
Source§fn wrapping_abs(self) -> Self
fn wrapping_abs(self) -> Self
See the inherent wrapping_abs method.
Source§fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self
fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent wrapping_add_unsigned method.
Source§fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self
fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent wrapping_sub_unsigned method.
type Unsigned = u16
Source§impl PrimitiveSigned for i32
impl PrimitiveSigned for i32
Source§fn checked_abs(self) -> Option<Self>
fn checked_abs(self) -> Option<Self>
See the inherent checked_abs method.
Source§fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
See the inherent checked_add_unsigned method.
Source§fn checked_isqrt(self) -> Option<Self>
fn checked_isqrt(self) -> Option<Self>
See the inherent checked_isqrt method.
Source§fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
See the inherent checked_sub_unsigned method.
Source§fn is_negative(self) -> bool
fn is_negative(self) -> bool
See the inherent is_negative method.
Source§fn is_positive(self) -> bool
fn is_positive(self) -> bool
See the inherent is_positive method.
Source§fn overflowing_abs(self) -> (Self, bool)
fn overflowing_abs(self) -> (Self, bool)
See the inherent overflowing_abs method.
Source§fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
See the inherent overflowing_add_unsigned method.
Source§fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
See the inherent overflowing_sub_unsigned method.
Source§fn saturating_abs(self) -> Self
fn saturating_abs(self) -> Self
See the inherent saturating_abs method.
Source§fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self
fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent saturating_add_unsigned method.
Source§fn saturating_neg(self) -> Self
fn saturating_neg(self) -> Self
See the inherent saturating_neg method.
Source§fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self
fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent saturating_sub_unsigned method.
Source§fn unsigned_abs(self) -> Self::Unsigned
fn unsigned_abs(self) -> Self::Unsigned
See the inherent unsigned_abs method.
Source§fn wrapping_abs(self) -> Self
fn wrapping_abs(self) -> Self
See the inherent wrapping_abs method.
Source§fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self
fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent wrapping_add_unsigned method.
Source§fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self
fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent wrapping_sub_unsigned method.
type Unsigned = u32
Source§impl PrimitiveSigned for i64
impl PrimitiveSigned for i64
Source§fn checked_abs(self) -> Option<Self>
fn checked_abs(self) -> Option<Self>
See the inherent checked_abs method.
Source§fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
See the inherent checked_add_unsigned method.
Source§fn checked_isqrt(self) -> Option<Self>
fn checked_isqrt(self) -> Option<Self>
See the inherent checked_isqrt method.
Source§fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
See the inherent checked_sub_unsigned method.
Source§fn is_negative(self) -> bool
fn is_negative(self) -> bool
See the inherent is_negative method.
Source§fn is_positive(self) -> bool
fn is_positive(self) -> bool
See the inherent is_positive method.
Source§fn overflowing_abs(self) -> (Self, bool)
fn overflowing_abs(self) -> (Self, bool)
See the inherent overflowing_abs method.
Source§fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
See the inherent overflowing_add_unsigned method.
Source§fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
See the inherent overflowing_sub_unsigned method.
Source§fn saturating_abs(self) -> Self
fn saturating_abs(self) -> Self
See the inherent saturating_abs method.
Source§fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self
fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent saturating_add_unsigned method.
Source§fn saturating_neg(self) -> Self
fn saturating_neg(self) -> Self
See the inherent saturating_neg method.
Source§fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self
fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent saturating_sub_unsigned method.
Source§fn unsigned_abs(self) -> Self::Unsigned
fn unsigned_abs(self) -> Self::Unsigned
See the inherent unsigned_abs method.
Source§fn wrapping_abs(self) -> Self
fn wrapping_abs(self) -> Self
See the inherent wrapping_abs method.
Source§fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self
fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent wrapping_add_unsigned method.
Source§fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self
fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent wrapping_sub_unsigned method.
type Unsigned = u64
Source§impl PrimitiveSigned for i128
impl PrimitiveSigned for i128
Source§fn checked_abs(self) -> Option<Self>
fn checked_abs(self) -> Option<Self>
See the inherent checked_abs method.
Source§fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
See the inherent checked_add_unsigned method.
Source§fn checked_isqrt(self) -> Option<Self>
fn checked_isqrt(self) -> Option<Self>
See the inherent checked_isqrt method.
Source§fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
See the inherent checked_sub_unsigned method.
Source§fn is_negative(self) -> bool
fn is_negative(self) -> bool
See the inherent is_negative method.
Source§fn is_positive(self) -> bool
fn is_positive(self) -> bool
See the inherent is_positive method.
Source§fn overflowing_abs(self) -> (Self, bool)
fn overflowing_abs(self) -> (Self, bool)
See the inherent overflowing_abs method.
Source§fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
See the inherent overflowing_add_unsigned method.
Source§fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
See the inherent overflowing_sub_unsigned method.
Source§fn saturating_abs(self) -> Self
fn saturating_abs(self) -> Self
See the inherent saturating_abs method.
Source§fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self
fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent saturating_add_unsigned method.
Source§fn saturating_neg(self) -> Self
fn saturating_neg(self) -> Self
See the inherent saturating_neg method.
Source§fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self
fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent saturating_sub_unsigned method.
Source§fn unsigned_abs(self) -> Self::Unsigned
fn unsigned_abs(self) -> Self::Unsigned
See the inherent unsigned_abs method.
Source§fn wrapping_abs(self) -> Self
fn wrapping_abs(self) -> Self
See the inherent wrapping_abs method.
Source§fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self
fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent wrapping_add_unsigned method.
Source§fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self
fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent wrapping_sub_unsigned method.
type Unsigned = u128
Source§impl PrimitiveSigned for isize
impl PrimitiveSigned for isize
Source§fn checked_abs(self) -> Option<Self>
fn checked_abs(self) -> Option<Self>
See the inherent checked_abs method.
Source§fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
fn checked_add_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
See the inherent checked_add_unsigned method.
Source§fn checked_isqrt(self) -> Option<Self>
fn checked_isqrt(self) -> Option<Self>
See the inherent checked_isqrt method.
Source§fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
fn checked_sub_unsigned(self, rhs: Self::Unsigned) -> Option<Self>
See the inherent checked_sub_unsigned method.
Source§fn is_negative(self) -> bool
fn is_negative(self) -> bool
See the inherent is_negative method.
Source§fn is_positive(self) -> bool
fn is_positive(self) -> bool
See the inherent is_positive method.
Source§fn overflowing_abs(self) -> (Self, bool)
fn overflowing_abs(self) -> (Self, bool)
See the inherent overflowing_abs method.
Source§fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
fn overflowing_add_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
See the inherent overflowing_add_unsigned method.
Source§fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
fn overflowing_sub_unsigned(self, rhs: Self::Unsigned) -> (Self, bool)
See the inherent overflowing_sub_unsigned method.
Source§fn saturating_abs(self) -> Self
fn saturating_abs(self) -> Self
See the inherent saturating_abs method.
Source§fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self
fn saturating_add_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent saturating_add_unsigned method.
Source§fn saturating_neg(self) -> Self
fn saturating_neg(self) -> Self
See the inherent saturating_neg method.
Source§fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self
fn saturating_sub_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent saturating_sub_unsigned method.
Source§fn unsigned_abs(self) -> Self::Unsigned
fn unsigned_abs(self) -> Self::Unsigned
See the inherent unsigned_abs method.
Source§fn wrapping_abs(self) -> Self
fn wrapping_abs(self) -> Self
See the inherent wrapping_abs method.
Source§fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self
fn wrapping_add_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent wrapping_add_unsigned method.
Source§fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self
fn wrapping_sub_unsigned(self, rhs: Self::Unsigned) -> Self
See the inherent wrapping_sub_unsigned method.