Function rgsl::power::pow_int_e[][src]

pub fn pow_int_e(x: f64, n: i32) -> (Value, Result)
Expand description

This routine computes the power x^n for integer n. The power is computed using the minimum number of multiplications. For example, x^8 is computed as ((x^2)^2)^2, requiring only 3 multiplications. For reasons of efficiency, these functions do not check for overflow or underflow conditions.

use rgsl::power::pow_int_e;

/* compute 3.0**12 */
println!("{:?}", pow_int_e(3., 12));