pub fn mul(lhs: &[u64], rhs: &[u64], result: &mut [u64]) -> bool
Expand description

⚠️ Computes result += lhs * rhs and checks for overflow.

Warning. This function is not part of the stable API.

Arrays are in little-endian order. All arrays can be arbitrary sized.

Algorithm

Uses the schoolbook multiplication algorithm.

Examples

let mut result = [0];
let overflow = mul(&[3], &[4], &mut result);
assert_eq!(overflow, false);
assert_eq!(result, [12]);