Corelib
pub trait WrappingMul
use core::num::traits::WrappingMul; let result = 10_u8.wrapping_mul(30); assert!(result == 44); // (10 * 30) % 256 = 44 let result = 200_u8.wrapping_mul(2); assert!(result == 144); // (200 * 2) % 256 = 144
self * other
fn wrapping_mul(self: T, v: T) -> T
Was this page helpful?