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

Wrapping subtraction of a scalar T to a PrimitiveArray of type T. It do nothing if the result overflows.

Examples

use arrow2::compute::arithmetics::basic::wrapping_sub_scalar;
use arrow2::array::Int8Array;

let a = Int8Array::from(&[None, Some(-100)]);
let result = wrapping_sub_scalar(&a, &100i8);
let expected = Int8Array::from(&[None, Some(56)]);
assert_eq!(result, expected);