/// Checked multiplication of a scalar T to a primitive array of type T. If the
/// result from the multiplication overflows, then the validity for that index is
/// changed to None
///
/// # Examples
/// ```
/// use arrow2::compute::arithmetics::basic::mul::checked_mul_scalar;
/// use arrow2::array::Int8Array;
///
/// let a = Int8Array::from(&[None, Some(100), None, Some(100)]);
/// let result = checked_mul_scalar(&a, &100i8);
/// let expected = Int8Array::from(&[None, None, None, None]);
/// assert_eq!(result, expected);
/// ```
Checked multiplication of a scalar T to a primitive array of type T. If the
result from the multiplication overflows, then the validity for that index is
changed to None
Checked multiplication of a scalar T to a primitive array of type T . If the result from the multiplication overflows then the validity for that index is changed to None
pub fn checked_mul_scalar<T>(lhs: &PrimitiveArray<T>, rhs: &T) -> PrimitiveArray<T>
where
    T: NativeType + CheckedMul<Output = T> + Zero,
{
    let rhs = *rhs;
    let op = move |a: T| a.checked_mul(&rhs);
    unary_checked(lhs, op, lhs.data_type().clone())
}
pub fn checked_mul_scalar < T > ( lhs : & PrimitiveArray < T > , rhs : & T ) -> PrimitiveArray < T > where T : NativeType + CheckedMul < Output = T > + Zero , { let rhs = * rhs ; let op = move | a : T | a . checked_mul ( & rhs ) ; unary_checked ( lhs , op , lhs . data_type ( ) . clone ( ) ) }
Checked multiplication of a scalar T to a primitive array of type T. If the
result from the multiplication overflows, then the validity for that index is
changed to None
Checked multiplication of a scalar T to a primitive array of type T . If the result from the multiplication overflows then the validity for that index is changed to None
lhs
&PrimitiveArray<T>
rhs
&T
examples
```
use arrow2::compute::arithmetics::basic::mul::checked_mul_scalar;
use arrow2::array::Int8Array.

let a = Int8Array::from(&[None, Some(100), None, Some(100)]);
let result = checked_mul_scalar(&a, &100i8);
let expected = Int8Array::from(&[None, None, None, None]);
assert_eq!(result, expected);
```
` ` ` use arrow2 :: compute :: arithmetics :: basic :: mul :: checked_mul_scalar ; use arrow2 :: array :: Int8Array . let a = Int8Array :: from ( & [ None Some ( 100 ) None Some ( 100 ) ] ) ; let result = checked_mul_scalar ( &a &100i8 ) ; let expected = Int8Array :: from ( & [ None None None None ] ) ; assert_eq! ( result expected ) ; ` ` `