pub fn powi(x: f64, n: i32) -> f64🔬This is a nightly-only experimental API. (
core_float_math #137578)Expand description
Experimental version of powi in core. See f64::powi for details.
§Examples
#![feature(core_float_math)]
use core::f64;
let x = 2.0_f64;
let abs_difference = (f64::math::powi(x, 2) - (x * x)).abs();
assert!(abs_difference <= 1e-6);
assert_eq!(f64::math::powi(f64::NAN, 0), 1.0);This standalone function is for testing only. It will be stabilized as an inherent method.