Method lrs::num::W64::saturating_add

Adds another integer to this one without overflow, trimming the value to the range that can be represented in this type.

Syntax

impl W64 {
    fn saturating_add(self, other: u64) -> W64
}

Arguments

NameDescription
other

Examples

let x: u8 = 200;
let y: u8 = 100;
assert!(x.saturating_add(y) == 255);