pub fn saturating_mul<T>(
    lhs: &PrimitiveArray<T>,
    rhs: &PrimitiveArray<T>,
) -> Result<PrimitiveArray<T>>
where
    T: NativeType + SaturatingMul<Output = T>,
{
    check_same_type(lhs, rhs)?;

    let op = move |a: T, b: T| a.saturating_mul(&b);

    binary(lhs, rhs, lhs.data_type().clone(), op)
}
/// Saturating multiplication of two primitive arrays. If the result from the
/// multiplication overflows, the result for the
/// operation will be the saturated value.
///
/// # Examples
/// ```
/// use arrow2::compute::arithmetics::basic::saturating_mul;
/// use arrow2::array::Int8Array;
///
/// let a = Int8Array::from(&[Some(-100i8)]);
/// let b = Int8Array::from(&[Some(100i8)]);
/// let result = saturating_mul(&a, &b).unwrap();
/// let expected = Int8Array::from(&[Some(-128)]);
/// assert_eq!(result, expected);
/// ```
Saturating multiplication of two primitive arrays. If the result from the
multiplication overflows, the result for the
operation will be the saturated value.
Saturating multiplication of two primitive arrays . If the result from the multiplication overflows the result for the operation will be the saturated value .
pub fn saturating_mul<T>(
    lhs: &PrimitiveArray<T>,
    rhs: &PrimitiveArray<T>,
) -> Result<PrimitiveArray<T>>
where
    T: NativeType + SaturatingMul<Output = T>,
{
    check_same_type(lhs, rhs)?;
    let op = move |a: T, b: T| a.saturating_mul(&b);
    binary(lhs, rhs, lhs.data_type().clone(), op)
}
pub fn saturating_mul < T > ( lhs : & PrimitiveArray < T > , rhs : & PrimitiveArray < T > , ) -> Result < PrimitiveArray < T > > where T : NativeType + SaturatingMul < Output = T > , { check_same_type ( lhs , rhs ) ? ; let op = move | a : T , b : T | a . saturating_mul ( & b ) ; binary ( lhs , rhs , lhs . data_type ( ) . clone ( ) , op ) }
Saturating multiplication of two primitive arrays.
Saturating multiplication of two primitive arrays .
lhs
&PrimitiveArray<T>
rhs
&PrimitiveArray<T>
lhs
&PrimitiveArray<T>
rhs
&PrimitiveArray<T>
examples
```
use arrow2::compute::arithmetics::basic::saturating_mul;
use arrow2::array::Int8Array.


` ` ` use arrow2 :: compute :: arithmetics :: basic :: saturating_mul ; use arrow2 :: array :: Int8Array .