Signature
Examples
Trait functions
wrapping_sub
Wrapping (modular) subtraction. Computesself - other, wrapping around at the boundary of
the type.
pub trait WrappingSub
use core::num::traits::WrappingSub;
let result = 0_u8.wrapping_sub(1);
assert!(result == 255);
let result = 100_u8.wrapping_sub(150);
assert!(result == 206);
self - other, wrapping around at the boundary of
the type.
fn wrapping_sub(self: T, v: T) -> T
Was this page helpful?