pub fn powf_scalar<T>(
    array: &PrimitiveArray<T>,
    exponent: T
) -> PrimitiveArray<T> where
    T: NativeArithmetics + Pow<T, Output = T>, 
Available on crate feature compute_arithmetics only.
Expand description

Raises an array of primitives to the power of exponent. Panics if one of the values values overflows.

Examples

use arrow2::compute::arithmetics::basic::powf_scalar;
use arrow2::array::Float32Array;

let a = Float32Array::from(&[Some(2f32), None]);
let actual = powf_scalar(&a, 2.0);
let expected = Float32Array::from(&[Some(4f32), None]);
assert_eq!(expected, actual);