pub fn rem_scalar<T>(lhs: &PrimitiveArray<T>, rhs: &T) -> PrimitiveArray<T> where
    T: NativeArithmetics + Rem<Output = T> + NumCast
Available on crate feature compute_arithmetics only.
Expand description

Remainder a primitive array of type T by a scalar T. Panics if the divisor is zero.

Examples

use arrow2::compute::arithmetics::basic::rem_scalar;
use arrow2::array::Int32Array;

let a = Int32Array::from(&[None, Some(6), None, Some(7)]);
let result = rem_scalar(&a, &2i32);
let expected = Int32Array::from(&[None, Some(0), None, Some(1)]);
assert_eq!(result, expected)