Signature
Examples
Trait functions
wrapping_mul
Wrapping (modular) multiplication. Computesself * other, wrapping around at the boundary
of the type.
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, wrapping around at the boundary
of the type.
fn wrapping_mul(self: T, v: T) -> T
Was this page helpful?