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