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§
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 Methods§
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.