Function arrow2::compute::arithmetics::basic::overflowing_mul_scalar
source · [−]pub fn overflowing_mul_scalar<T>(
lhs: &PrimitiveArray<T>,
rhs: &T
) -> (PrimitiveArray<T>, Bitmap) where
T: NativeArithmetics + OverflowingMul<Output = T>,
Expand description
Overflowing multiplication of a scalar T to a primitive array of type T. If the result from the mul overflows for this type, then the result will be an array with overflowed values and a validity array indicating the overflowing elements from the array
Examples
use arrow2::compute::arithmetics::basic::overflowing_mul_scalar;
use arrow2::array::Int8Array;
let a = Int8Array::from(&[Some(1i8), Some(100i8)]);
let (result, overflow) = overflowing_mul_scalar(&a, &100i8);
let expected = Int8Array::from(&[Some(100i8), Some(16i8)]);
assert_eq!(result, expected);