Module malachite_base::num::arithmetic::pow
source · Expand description
Pow
and PowAssign
, traits for raising a number to a
power.
§pow_assign
use malachite_base::num::arithmetic::traits::PowAssign;
let mut x = 3u8;
x.pow_assign(3);
assert_eq!(x, 27);
let mut x = -10i32;
x.pow_assign(9);
assert_eq!(x, -1000000000);
let mut x = 2.0f32;
x.pow_assign(5);
assert_eq!(x, 32.0);
let mut x = 2.0f32;
x.pow_assign(5.0);
assert_eq!(x, 32.0);