PrecisionFloat

Trait PrecisionFloat 

Source
pub trait PrecisionFloat:
    Clone
    + Debug
    + Display
    + PartialEq
    + PartialOrd
    + Add<Output = Self>
    + Sub<Output = Self>
    + Mul<Output = Self>
    + Div<Output = Self>
    + Neg<Output = Self>
    + Send
    + Sync
    + 'static {
Show 26 methods // Required methods fn from_f64(value: f64) -> Self; fn to_f64(&self) -> f64; fn sqrt_precise(self) -> Self; fn powf_precise(self, exp: Self) -> Self; fn sin_precise(self) -> Self; fn cos_precise(self) -> Self; fn tan_precise(self) -> Self; fn sinh_precise(self) -> Self; fn cosh_precise(self) -> Self; fn tanh_precise(self) -> Self; fn ln_precise(self) -> Self; fn exp_precise(self) -> Self; fn abs_precise(self) -> Self; fn epsilon() -> Self; fn default_tolerance() -> Self; fn orbital_tolerance() -> Self; fn PI() -> Self; fn one() -> Self; fn zero() -> Self; fn max(self, other: Self) -> Self; fn min(self, other: Self) -> Self; // Provided methods fn sqrt(self) -> Self { ... } fn abs(self) -> Self { ... } fn zero_array_4() -> [Self; 4] { ... } fn zero_matrix_4x4() -> [[Self; 4]; 4] { ... } fn zero_tensor_4x4x4() -> [[[Self; 4]; 4]; 4] { ... }
}
Expand description

Unified trait for floating-point arithmetic in scientific computing

This trait abstracts over different precision levels to allow mathematical calculations with appropriate numerical accuracy.

Required Methods§

Source

fn from_f64(value: f64) -> Self

Create from f64 value

Source

fn to_f64(&self) -> f64

Convert to f64 (may lose precision)

Source

fn sqrt_precise(self) -> Self

Square root with high precision

Source

fn powf_precise(self, exp: Self) -> Self

Power function with high precision

Source

fn sin_precise(self) -> Self

Trigonometric functions with high precision

Source

fn cos_precise(self) -> Self

Cosine function with high precision

Source

fn tan_precise(self) -> Self

Tangent function with high precision

Source

fn sinh_precise(self) -> Self

Hyperbolic functions with high precision

Source

fn cosh_precise(self) -> Self

Hyperbolic cosine with high precision

Source

fn tanh_precise(self) -> Self

Hyperbolic tangent with high precision

Source

fn ln_precise(self) -> Self

Natural logarithm with high precision

Source

fn exp_precise(self) -> Self

Exponential function with high precision

Source

fn abs_precise(self) -> Self

Absolute value

Source

fn epsilon() -> Self

Machine epsilon for this precision level

Source

fn default_tolerance() -> Self

Recommended tolerance for numerical calculations

Source

fn orbital_tolerance() -> Self

Specialized tolerance for orbital mechanics calculations

Source

fn PI() -> Self

Mathematical constant π

Source

fn one() -> Self

The multiplicative identity (1)

Source

fn zero() -> Self

The additive identity (0)

Source

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

Maximum of two values

Source

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

Minimum of two values

Provided Methods§

Source

fn sqrt(self) -> Self

Square root function (delegated to sqrt_precise)

Source

fn abs(self) -> Self

Absolute value function (delegated to abs_precise)

Source

fn zero_array_4() -> [Self; 4]

Create a 4-element array filled with zero values

Source

fn zero_matrix_4x4() -> [[Self; 4]; 4]

Create a 4x4 matrix filled with zero values

Source

fn zero_tensor_4x4x4() -> [[[Self; 4]; 4]; 4]

Create a 4x4x4 tensor filled with zero values

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 PrecisionFloat for f64

Standard f64 implementation for general use

Source§

fn from_f64(value: f64) -> Self

Source§

fn to_f64(&self) -> f64

Source§

fn sqrt_precise(self) -> Self

Source§

fn powf_precise(self, exp: Self) -> Self

Source§

fn sin_precise(self) -> Self

Source§

fn cos_precise(self) -> Self

Source§

fn tan_precise(self) -> Self

Source§

fn sinh_precise(self) -> Self

Source§

fn cosh_precise(self) -> Self

Source§

fn tanh_precise(self) -> Self

Source§

fn ln_precise(self) -> Self

Source§

fn exp_precise(self) -> Self

Source§

fn abs_precise(self) -> Self

Source§

fn epsilon() -> Self

Source§

fn default_tolerance() -> Self

Source§

fn orbital_tolerance() -> Self

Source§

fn PI() -> Self

Source§

fn one() -> Self

Source§

fn zero() -> Self

Source§

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

Source§

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

Implementors§

Source§

impl PrecisionFloat for DashuFloat

Available on (crate features high-precision or wasm-precision) and non-crate feature native-precision only.