Function polars::export::arrow::compute::arithmetics::basic::checked_powf_scalar
source · [−]pub fn checked_powf_scalar<T>(
array: &PrimitiveArray<T>,
exponent: usize
) -> PrimitiveArray<T> where
T: NativeArithmetics + CheckedMul + One,
This is supported on crate feature
compute_arithmetics
only.Expand description
Checked operation of raising an array of primitives to the power of exponent. If the result from the multiplications overflows, the validity for that index is changed returned.
Examples
use arrow2::compute::arithmetics::basic::checked_powf_scalar;
use arrow2::array::Int8Array;
let a = Int8Array::from(&[Some(1i8), None, Some(7i8)]);
let actual = checked_powf_scalar(&a, 8usize);
let expected = Int8Array::from(&[Some(1i8), None, None]);
assert_eq!(expected, actual);