Signature
Examples
Trait functions
saturating_sub
Saturating subtraction. Computesself - other, saturating at the relevant high or low
boundary of the type.
pub trait SaturatingSub
use core::num::traits::SaturatingSub;
assert!(1_u8.saturating_sub(2_u8) == 0);
self - other, saturating at the relevant high or low
boundary of the type.
fn saturating_sub(self: T, other: T) -> T
Was this page helpful?