Trait FixedPowF

Source
pub trait FixedPowF: Fixed {
    // Required method
    fn powf(self, n: Self) -> Self;
}
Expand description

Extension trait providing fixed-point exponentiation for fixed-point numbers.

This is only implemented for types that can represent numbers larger than 1.

Required Methods§

Source

fn powf(self, n: Self) -> Self

Raises a number to a fixed-point power.

§Panics
  • If self is negative and n is fractional.
§Examples
use fixed::types::I32F32;
use fixed_exp::FixedPowF;

let x = I32F32::from_num(4.0);
assert_eq!(I32F32::from_num(8.0), x.powf(I32F32::from_num(1.5)));

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<Frac> FixedPowF for FixedI8<Frac>
where Frac: LeEqU8 + IsLessOrEqual<U6, Output = True>,

Source§

fn powf(self, n: Self) -> Self

Source§

impl<Frac> FixedPowF for FixedI16<Frac>
where Frac: LeEqU16 + IsLessOrEqual<U14, Output = True>,

Source§

fn powf(self, n: Self) -> Self

Source§

impl<Frac> FixedPowF for FixedI32<Frac>
where Frac: LeEqU32 + IsLessOrEqual<U30, Output = True>,

Source§

fn powf(self, n: Self) -> Self

Source§

impl<Frac> FixedPowF for FixedI64<Frac>
where Frac: LeEqU64 + IsLessOrEqual<U62, Output = True>,

Source§

fn powf(self, n: Self) -> Self

Source§

impl<Frac> FixedPowF for FixedI128<Frac>
where Frac: LeEqU128 + IsLessOrEqual<U126, Output = True>,

Source§

fn powf(self, n: Self) -> Self

Source§

impl<Frac> FixedPowF for FixedU8<Frac>
where Frac: LeEqU8 + IsLessOrEqual<U7, Output = True>,

Source§

fn powf(self, n: Self) -> Self

Source§

impl<Frac> FixedPowF for FixedU16<Frac>
where Frac: LeEqU16 + IsLessOrEqual<U15, Output = True>,

Source§

fn powf(self, n: Self) -> Self

Source§

impl<Frac> FixedPowF for FixedU32<Frac>
where Frac: LeEqU32 + IsLessOrEqual<U31, Output = True>,

Source§

fn powf(self, n: Self) -> Self

Source§

impl<Frac> FixedPowF for FixedU64<Frac>
where Frac: LeEqU64 + IsLessOrEqual<U63, Output = True>,

Source§

fn powf(self, n: Self) -> Self

Source§

impl<Frac> FixedPowF for FixedU128<Frac>
where Frac: LeEqU128 + IsLessOrEqual<U127, Output = True>,

Source§

fn powf(self, n: Self) -> Self

Implementors§