/// Performs primitive operation on an array and and scalar
Performs primitive operation on an array and and scalar
Performs primitive operation on an array and and scalar
pub fn arithmetic_primitive_scalar<T>(
    lhs: &PrimitiveArray<T>,
    op: Operator,
    rhs: &T,
) -> Result<PrimitiveArray<T>>
where
    T: NativeType
        + Div<Output = T>
        + Zero
        + Add<Output = T>
        + Sub<Output = T>
        + Mul<Output = T>
        + Rem<Output = T>
        + NumCast,
{
    match op {
        Operator::Add => Ok(basic::add_scalar(lhs, rhs)),
        Operator::Subtract => Ok(basic::sub_scalar(lhs, rhs)),
        Operator::Multiply => Ok(basic::mul_scalar(lhs, rhs)),
        Operator::Divide => Ok(basic::div_scalar(lhs, rhs)),
        Operator::Remainder => Ok(basic::rem_scalar(lhs, rhs)),
    }
}
pub fn arithmetic_primitive_scalar < T > ( lhs : & PrimitiveArray < T > , op : Operator , rhs : & T , ) -> Result < PrimitiveArray < T > > where T : NativeType + Div < Output = T > + Zero + Add < Output = T > + Sub < Output = T > + Mul < Output = T > + Rem < Output = T > + NumCast , { match op { Operator :: Add => Ok ( basic :: add_scalar ( lhs , rhs ) ) , Operator :: Subtract => Ok ( basic :: sub_scalar ( lhs , rhs ) ) , Operator :: Multiply => Ok ( basic :: mul_scalar ( lhs , rhs ) ) , Operator :: Divide => Ok ( basic :: div_scalar ( lhs , rhs ) ) , Operator :: Remainder => Ok ( basic :: rem_scalar ( lhs , rhs ) ) , } }
Performs primitive operation on an array and and scalar
Performs primitive operation on an array and and scalar
lhs
&PrimitiveArray<T>
op
Operator
rhs
&T