Corelib
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
fn wrapping_sub(self: T, v: T) -> T
Was this page helpful?