Skip to main content

Scalar

Trait Scalar 

Source
pub trait Scalar:
    Float
    + FromPrimitive
    + Copy
    + Clone
    + Default
    + Debug
    + PartialOrd
    + Add<Output = Self>
    + Sub<Output = Self>
    + Mul<Output = Self>
    + Div<Output = Self>
    + Send
    + Sync
    + 'static {
    const ZERO: Self;
    const ONE: Self;

    // Required methods
    fn min_positive() -> Self;
    fn to_f64(self) -> f64;
}
Expand description

Scalar type shared by generic math, mesh, field, and FEM infrastructure. Floating-point operations, including Float::min and Float::max, are exposed through the Float supertrait.

Required Associated Constants§

Source

const ZERO: Self

Source

const ONE: Self

Required Methods§

Source

fn min_positive() -> Self

Return the smallest positive finite value for this scalar type.

Source

fn to_f64(self) -> f64

Convert this scalar value to f64 for diagnostics and tolerances.

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 Scalar for f32

Source§

fn min_positive() -> Self

Return the smallest positive finite value for this scalar type.

Source§

fn to_f64(self) -> f64

Convert this scalar value to f64 for diagnostics and tolerances.

Source§

const ZERO: Self = 0.0

Source§

const ONE: Self = 1.0

Source§

impl Scalar for f64

Source§

fn min_positive() -> Self

Return the smallest positive finite value for this scalar type.

Source§

fn to_f64(self) -> f64

Convert this scalar value to f64 for diagnostics and tolerances.

Source§

const ZERO: Self = 0.0

Source§

const ONE: Self = 1.0

Implementors§