Function arrow2::compute::arithmetics::basic::wrapping_mul
source · [−]pub fn wrapping_mul<T>(
lhs: &PrimitiveArray<T>,
rhs: &PrimitiveArray<T>
) -> PrimitiveArray<T> where
T: NativeArithmetics + WrappingMul<Output = T>,
Expand description
Wrapping multiplication of two PrimitiveArray
s.
It wraps around at the boundary of the type if the result overflows.
Examples
use arrow2::compute::arithmetics::basic::wrapping_mul;
use arrow2::array::PrimitiveArray;
let a = PrimitiveArray::from([Some(100i8), Some(0x10i8), Some(100i8)]);
let b = PrimitiveArray::from([Some(0i8), Some(0x10i8), Some(0i8)]);
let result = wrapping_mul(&a, &b);
let expected = PrimitiveArray::from([Some(0), Some(0), Some(0)]);
assert_eq!(result, expected);