pub trait Value:
Scalar
+ ComplexField<RealField = Self>
+ RealField
+ FloatCore
+ LowerExp {
Show 20 methods
// Provided methods
fn two() -> Self { ... }
fn half() -> Self { ... }
fn try_cast<U: NumCast>(n: U) -> Result<Self, Error> { ... }
fn as_usize(&self) -> Option<usize> { ... }
fn powi(self, n: i32) -> Self { ... }
fn abs(self) -> Self { ... }
fn abs_sub(self, other: Self) -> Self { ... }
fn is_sign_negative(&self) -> bool { ... }
fn clamp(self, min: Self, max: Self) -> Self { ... }
fn min(self, other: Self) -> Self { ... }
fn max(self, other: Self) -> Self { ... }
fn ceil(self) -> Self { ... }
fn floor(self) -> Self { ... }
fn is_near_zero(&self) -> bool { ... }
fn is_finite(value: Self) -> bool { ... }
fn f_signum(&self) -> Self { ... }
fn factorial(n: usize) -> Self { ... }
fn integer_binomial(n: usize, k: usize) -> Self { ... }
fn binomial(n: Self, k: Self) -> Self { ... }
fn from_positive_int(n: usize) -> Self { ... }
}Expand description
Numeric type for curves
Provided Methods§
Sourcefn is_sign_negative(&self) -> bool
fn is_sign_negative(&self) -> bool
Check if the value is negative
Sourcefn is_near_zero(&self) -> bool
fn is_near_zero(&self) -> bool
Returns the machine epsilon for the numeric type.
Sourcefn f_signum(&self) -> Self
fn f_signum(&self) -> Self
Returns the sign of the value as a numeric type
This function returns -1 for negative values, 1 for positive values, and NaN for NaN values.
Sourcefn integer_binomial(n: usize, k: usize) -> Self
fn integer_binomial(n: usize, k: usize) -> Self
Computes the binomial coefficient “n choose k” for integer n and k.
Sourcefn from_positive_int(n: usize) -> Self
fn from_positive_int(n: usize) -> Self
Converts a usize to the target numeric type.
Results in infinity if the value is out of range.
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.