Skip to main content

fast_power

Function fast_power 

Source
pub fn fast_power(base: f64, exponent: i64) -> Result<f64, Error>
Expand description

Exponentiation by squaring. Returns Err(Error::InvalidInput) when base is zero and exponent is negative. By convention, 0^0 returns 1.0.