Skip to main content

Inverse

Trait Inverse 

Source
pub trait Inverse {
    type Output;

    // Required method
    fn inv(self) -> Self::Output;
}
Expand description

Compute the multiplicative inverse (aka. reciprocal) of the number.

§Examples

assert_eq!(0.1234.inv(), 8.103727714748784);
assert_eq!(f32::INFINITY.inv(), 0f32);

Required Associated Types§

Source

type Output

The type of the reciprocal.

Required Methods§

Source

fn inv(self) -> Self::Output

Compute the multiplicative inverse (reciprocal) of the number.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Inverse for &f32

Source§

type Output = f32

Source§

fn inv(self) -> f32

Source§

impl Inverse for &f64

Source§

type Output = f64

Source§

fn inv(self) -> f64

Source§

impl Inverse for f32

Source§

type Output = f32

Source§

fn inv(self) -> f32

Source§

impl Inverse for f64

Source§

type Output = f64

Source§

fn inv(self) -> f64

Implementors§