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

Remainder of two primitive arrays with the same type. Panics if the divisor is zero of one pair of values overflows.

Examples

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

let a = Int32Array::from(&[Some(10), Some(7)]);
let b = Int32Array::from(&[Some(5), Some(6)]);
let result = rem(&a, &b);
let expected = Int32Array::from(&[Some(0), Some(1)]);
assert_eq!(result, expected)