[−][src]Trait sp_runtime::traits::Saturating
Saturating arithmetic operations, returning maximum or minimum values instead of overflowing.
Required methods
pub fn saturating_add(self, rhs: Self) -> Self
[src]
Saturating addition. Compute self + rhs
, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_sub(self, rhs: Self) -> Self
[src]
Saturating subtraction. Compute self - rhs
, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_mul(self, rhs: Self) -> Self
[src]
Saturating multiply. Compute self * rhs
, saturating at the numeric bounds instead of
overflowing.
pub fn saturating_pow(self, exp: usize) -> Self
[src]
Saturating exponentiation. Compute self.pow(exp)
, saturating at the numeric bounds
instead of overflowing.
Implementors
impl Saturating for FixedI64
[src]
pub fn saturating_add(self, rhs: FixedI64) -> FixedI64
[src]
pub fn saturating_sub(self, rhs: FixedI64) -> FixedI64
[src]
pub fn saturating_mul(self, rhs: FixedI64) -> FixedI64
[src]
pub fn saturating_pow(self, exp: usize) -> FixedI64
[src]
impl Saturating for FixedI128
[src]
pub fn saturating_add(self, rhs: FixedI128) -> FixedI128
[src]
pub fn saturating_sub(self, rhs: FixedI128) -> FixedI128
[src]
pub fn saturating_mul(self, rhs: FixedI128) -> FixedI128
[src]
pub fn saturating_pow(self, exp: usize) -> FixedI128
[src]
impl Saturating for FixedU128
[src]
pub fn saturating_add(self, rhs: FixedU128) -> FixedU128
[src]
pub fn saturating_sub(self, rhs: FixedU128) -> FixedU128
[src]
pub fn saturating_mul(self, rhs: FixedU128) -> FixedU128
[src]
pub fn saturating_pow(self, exp: usize) -> FixedU128
[src]
impl Saturating for PerU16
[src]
pub fn saturating_add(self, rhs: PerU16) -> PerU16
[src]
Saturating addition. Compute self + rhs
, saturating at the numeric bounds instead of
overflowing. This operation is lossless if it does not saturate.
pub fn saturating_sub(self, rhs: PerU16) -> PerU16
[src]
Saturating subtraction. Compute self - rhs
, saturating at the numeric bounds instead of
overflowing. This operation is lossless if it does not saturate.
pub fn saturating_mul(self, rhs: PerU16) -> PerU16
[src]
Saturating multiply. Compute self * rhs
, saturating at the numeric bounds instead of
overflowing. This operation is lossy.
pub fn saturating_pow(self, exp: usize) -> PerU16
[src]
Saturating exponentiation. Computes self.pow(exp)
, saturating at the numeric
bounds instead of overflowing. This operation is lossy.
impl Saturating for Perbill
[src]
pub fn saturating_add(self, rhs: Perbill) -> Perbill
[src]
Saturating addition. Compute self + rhs
, saturating at the numeric bounds instead of
overflowing. This operation is lossless if it does not saturate.
pub fn saturating_sub(self, rhs: Perbill) -> Perbill
[src]
Saturating subtraction. Compute self - rhs
, saturating at the numeric bounds instead of
overflowing. This operation is lossless if it does not saturate.
pub fn saturating_mul(self, rhs: Perbill) -> Perbill
[src]
Saturating multiply. Compute self * rhs
, saturating at the numeric bounds instead of
overflowing. This operation is lossy.
pub fn saturating_pow(self, exp: usize) -> Perbill
[src]
Saturating exponentiation. Computes self.pow(exp)
, saturating at the numeric
bounds instead of overflowing. This operation is lossy.
impl Saturating for Percent
[src]
pub fn saturating_add(self, rhs: Percent) -> Percent
[src]
Saturating addition. Compute self + rhs
, saturating at the numeric bounds instead of
overflowing. This operation is lossless if it does not saturate.
pub fn saturating_sub(self, rhs: Percent) -> Percent
[src]
Saturating subtraction. Compute self - rhs
, saturating at the numeric bounds instead of
overflowing. This operation is lossless if it does not saturate.
pub fn saturating_mul(self, rhs: Percent) -> Percent
[src]
Saturating multiply. Compute self * rhs
, saturating at the numeric bounds instead of
overflowing. This operation is lossy.
pub fn saturating_pow(self, exp: usize) -> Percent
[src]
Saturating exponentiation. Computes self.pow(exp)
, saturating at the numeric
bounds instead of overflowing. This operation is lossy.
impl Saturating for Permill
[src]
pub fn saturating_add(self, rhs: Permill) -> Permill
[src]
Saturating addition. Compute self + rhs
, saturating at the numeric bounds instead of
overflowing. This operation is lossless if it does not saturate.
pub fn saturating_sub(self, rhs: Permill) -> Permill
[src]
Saturating subtraction. Compute self - rhs
, saturating at the numeric bounds instead of
overflowing. This operation is lossless if it does not saturate.
pub fn saturating_mul(self, rhs: Permill) -> Permill
[src]
Saturating multiply. Compute self * rhs
, saturating at the numeric bounds instead of
overflowing. This operation is lossy.
pub fn saturating_pow(self, exp: usize) -> Permill
[src]
Saturating exponentiation. Computes self.pow(exp)
, saturating at the numeric
bounds instead of overflowing. This operation is lossy.
impl Saturating for Perquintill
[src]
pub fn saturating_add(self, rhs: Perquintill) -> Perquintill
[src]
Saturating addition. Compute self + rhs
, saturating at the numeric bounds instead of
overflowing. This operation is lossless if it does not saturate.
pub fn saturating_sub(self, rhs: Perquintill) -> Perquintill
[src]
Saturating subtraction. Compute self - rhs
, saturating at the numeric bounds instead of
overflowing. This operation is lossless if it does not saturate.
pub fn saturating_mul(self, rhs: Perquintill) -> Perquintill
[src]
Saturating multiply. Compute self * rhs
, saturating at the numeric bounds instead of
overflowing. This operation is lossy.
pub fn saturating_pow(self, exp: usize) -> Perquintill
[src]
Saturating exponentiation. Computes self.pow(exp)
, saturating at the numeric
bounds instead of overflowing. This operation is lossy.
impl<T> Saturating for T where
T: Clone + PartialOrd<T> + Bounded + Zero + One + CheckedMul + Saturating,
[src]
T: Clone + PartialOrd<T> + Bounded + Zero + One + CheckedMul + Saturating,