pub fn divide_scalar<T>(array: &PrimitiveArray<T>, divisor: &T) -> Result<PrimitiveArray<T>>
where
    T: NativeType,
    T: Div<Output = T> + Zero,
{
    if divisor.is_zero() {
        return Err(ArrowError::InvalidArgumentError(
            "The divisor cannot be zero".to_string(),
        ));
    }
    let divisor = *divisor;
    Ok(unary(array, |x| x / divisor, array.data_type()))
}
/// Divide an array by a constant
Divide an array by a constant
Divide an array by a constant
pub fn divide_scalar<T>(array: &PrimitiveArray<T>, divisor: &T) -> Result<PrimitiveArray<T>>
where
    T: NativeType,
    T: Div<Output = T> + Zero,
{
    if divisor.is_zero() {
        return Err(ArrowError::InvalidArgumentError(
            "The divisor cannot be zero".to_string(),
        ));
    }
    let divisor = *divisor;
    Ok(unary(array, |x| x / divisor, array.data_type()))
}
pub fn divide_scalar < T > ( array : & PrimitiveArray < T > , divisor : & T ) -> Result < PrimitiveArray < T > > where T : NativeType , T : Div < Output = T > + Zero , { if divisor . is_zero ( ) { return Err ( ArrowError :: InvalidArgumentError ( " " . to_string ( ) , ) ) ; } let divisor = * divisor ; Ok ( unary ( array , | x | x / divisor , array . data_type ( ) ) ) }
Divide an array by a constant
Divide an array by a constant
array
&PrimitiveArray<T>
divisor
&T
array
&PrimitiveArray<T>
divisor
&T