Skip to main content

LinalgFloat

Trait LinalgFloat 

Source
pub trait LinalgFloat:
    LinalgScalar<LinalgReal = Self>
    + PartialOrd
    + Sealed {
    type Complex: LinalgScalar<LinalgReal = Self>;

    const EPSILON: Self;
    const MIN_POSITIVE: Self;

    // Required methods
    fn sqrt(self) -> Self;
    fn hypot(self, other: Self) -> Self;
    fn copysign(self, sign: Self) -> Self;
    fn is_nan(self) -> bool;
}
Expand description

The real element types of linear algebra: f32 and f64.

Required Associated Constants§

Source

const EPSILON: Self

The machine epsilon (dlamch('E') is half of it).

Source

const MIN_POSITIVE: Self

The smallest positive normal number (dlamch('S')).

Required Associated Types§

Source

type Complex: LinalgScalar<LinalgReal = Self>

The complex type of this real type (c64 for f32).

Required Methods§

Source

fn sqrt(self) -> Self

The square root.

Source

fn hypot(self, other: Self) -> Self

sqrt(self^2 + other^2) without undue overflow.

Source

fn copysign(self, sign: Self) -> Self

|self| with the sign of sign.

Source

fn is_nan(self) -> bool

Whether the value is NaN.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl LinalgFloat for f32

Source§

const EPSILON: Self = f32::EPSILON

Source§

const MIN_POSITIVE: Self = f32::MIN_POSITIVE

Source§

type Complex = Complex<f32>

Source§

fn sqrt(self) -> Self

Source§

fn hypot(self, other: Self) -> Self

Source§

fn copysign(self, sign: Self) -> Self

Source§

fn is_nan(self) -> bool

Source§

impl LinalgFloat for f64

Source§

const EPSILON: Self = f64::EPSILON

Source§

const MIN_POSITIVE: Self = f64::MIN_POSITIVE

Source§

type Complex = Complex<f64>

Source§

fn sqrt(self) -> Self

Source§

fn hypot(self, other: Self) -> Self

Source§

fn copysign(self, sign: Self) -> Self

Source§

fn is_nan(self) -> bool

Implementors§