Real

Trait Real 

Source
pub trait Real:
    Copy
    + Clone
    + PartialOrd
    + PartialEq
    + Debug
    + Add<Output = Self>
    + Sub<Output = Self>
    + Mul<Output = Self>
    + Div<Output = Self>
    + Neg<Output = Self>
    + From<f32> {
    // Required methods
    fn pi() -> Self;
    fn sqrt(self) -> Self;
    fn recip(self) -> Self;
    fn abs(self) -> Self;
    fn max(self, other: Self) -> Self;
    fn min(self, other: Self) -> Self;
    fn exp(self) -> Self;
    fn sin(self) -> Self;
    fn cos(self) -> Self;
    fn acos(self) -> Self;

    // Provided method
    fn rsqrt(self) -> Self { ... }
}
Expand description

Abstract trait for floating-point operations required by force field kernels.

This trait abstracts over f32 and f64, providing a unified interface for mathematical functions whether in std or no_std environments.

Required Methods§

Source

fn pi() -> Self

Source

fn sqrt(self) -> Self

Source

fn recip(self) -> Self

Source

fn abs(self) -> Self

Source

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

Source

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

Source

fn exp(self) -> Self

Source

fn sin(self) -> Self

Source

fn cos(self) -> Self

Source

fn acos(self) -> Self

Provided Methods§

Source

fn rsqrt(self) -> Self

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

Source§

fn pi() -> Self

Source§

fn sqrt(self) -> Self

Source§

fn recip(self) -> Self

Source§

fn abs(self) -> Self

Source§

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

Source§

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

Source§

fn exp(self) -> Self

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn acos(self) -> Self

Source§

impl Real for f64

Source§

fn pi() -> Self

Source§

fn sqrt(self) -> Self

Source§

fn recip(self) -> Self

Source§

fn abs(self) -> Self

Source§

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

Source§

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

Source§

fn exp(self) -> Self

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn acos(self) -> Self

Implementors§