pub trait Scalar:
Sized
+ Num
+ NumAssignOps
+ Neg<Output = Self>
+ PartialOrd
+ Clone
+ Copy {
// Required methods
fn two() -> Self;
fn half() -> Self;
fn quarter() -> Self;
fn l8192() -> Self;
fn epsilon() -> Self;
fn min(l: Self, r: Self) -> Self;
fn max(l: Self, r: Self) -> Self;
fn tabs(self) -> Self;
// Provided method
fn squared(self) -> Self { ... }
}
Expand description
Core scalar trait for numeric types used in the library.
This trait extends num-traits
types with additional methods
commonly needed in 3D mathematics. It is implemented for
i32
, i64
, f32
, and f64
.
§Required Methods
Types implementing this trait must provide:
- Basic arithmetic operations (via
Num
andNumAssignOps
) - Comparison operations (via
PartialOrd
) - Additional constants and utility methods
Required Methods§
fn two() -> Self
fn half() -> Self
fn quarter() -> Self
fn l8192() -> Self
fn epsilon() -> Self
fn min(l: Self, r: Self) -> Self
fn max(l: Self, r: Self) -> Self
fn tabs(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.