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

Divides 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::div;
use arrow2::array::Int32Array;

let a = Int32Array::from(&[Some(10), Some(1), Some(6)]);
let b = Int32Array::from(&[Some(5), None, Some(6)]);
let result = div(&a, &b);
let expected = Int32Array::from(&[Some(2), None, Some(1)]);
assert_eq!(result, expected)