/// Perform arithmetic operations on two primitive arrays based on the Operator enum
//
Perform arithmetic operations on two primitive arrays based on the Operator enum
Perform arithmetic operations on two primitive arrays based on the Operator enum
pub fn arithmetic_primitive<T>(
    lhs: &PrimitiveArray<T>,
    op: Operator,
    rhs: &PrimitiveArray<T>,
) -> Result<PrimitiveArray<T>>
where
    T: NativeType
        + Div<Output = T>
        + Zero
        + Add<Output = T>
        + Sub<Output = T>
        + Mul<Output = T>
        + Rem<Output = T>,
{
    match op {
        Operator::Add => basic::add(lhs, rhs),
        Operator::Subtract => basic::sub(lhs, rhs),
        Operator::Multiply => basic::mul(lhs, rhs),
        Operator::Divide => basic::div(lhs, rhs),
        Operator::Remainder => basic::rem(lhs, rhs),
    }
}
pub fn arithmetic_primitive < T > ( lhs : & PrimitiveArray < T > , op : Operator , rhs : & PrimitiveArray < T > , ) -> Result < PrimitiveArray < T > > where T : NativeType + Div < Output = T > + Zero + Add < Output = T > + Sub < Output = T > + Mul < Output = T > + Rem < Output = T > , { match op { Operator :: Add => basic :: add ( lhs , rhs ) , Operator :: Subtract => basic :: sub ( lhs , rhs ) , Operator :: Multiply => basic :: mul ( lhs , rhs ) , Operator :: Divide => basic :: div ( lhs , rhs ) , Operator :: Remainder => basic :: rem ( lhs , rhs ) , } }
Perform arithmetic operations on two primitive arrays based on the Operator enum
Perform arithmetic operations on two primitive arrays based on the Operator enum
lhs
&PrimitiveArray<T>
op
Operator
rhs
&PrimitiveArray<T>