Skip to main content

ldexp

Function ldexp 

Source
pub fn ldexp<F: Float>(a: impl IntoArray<F>, e: impl IntoArray<i32>) -> Array<F>
Expand description

Equivalent of np.ldexp(a, e): a * 2**e with an integer exponent array.

use rustnum as np;
let r = np::ldexp(np::array![1.0, 0.5, 3.0], np::array![1, 2, -1]);
assert_eq!(r.to_vec(), [2.0, 2.0, 1.5]);