pub trait Numeric:
Num
+ NumCast
+ Copy
+ PartialOrd
+ Zero
+ One
+ Neg<Output = Self>
+ Debug
+ Send
+ Sync
+ 'static {
// Required methods
fn supports_bitwise() -> bool;
fn is_float() -> bool;
fn numeric_pow(self, exp: Self) -> Option<Self>;
}Expand description
Trait for types that can be used as numeric values in expressions.
This is a marker trait that combines the necessary bounds for basic arithmetic operations. Both float and integer types implement this.
Required Methods§
Sourcefn supports_bitwise() -> bool
fn supports_bitwise() -> bool
Whether this type supports bitwise operations.
Sourcefn numeric_pow(self, exp: Self) -> Option<Self>
fn numeric_pow(self, exp: Self) -> Option<Self>
Compute self raised to the power of exp. For floats, uses powf. For integers, uses repeated multiplication (returns None for negative exponents).
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.