num-traits
num-traits copied to clipboard
Numeric traits for generic mathematics in Rust
If/when breaking changes are released, I think adding the `Send` and `Sync` bounds to `PrimInt`, in addition to the existing suggestions in #44 . cc #47
This is the definition of `integer_decode`: ```rust fn integer_decode(self) -> (u64, i16, i8) ``` The 64 bits allocated for the mantissa is too small, 112 bits would be required to...
Since it is available for f32 and f64.
Hello, Modular arithmetic being a common mathematical and computational concept, would it make sense to add support for it to this library? I was thinking that implementing traits such as...
There arlready is a trait for the inverse. There should also be a trait to represent the complex conjugate and equivalents. For inbuilt numbers, this would just return the number...
I am creating a library where I would like to abstract math over scalar (`f32`) or packed SIMD types (`f32x8`) as defined in [RFC 2366](https://github.com/rust-lang/rfcs/pull/2366). For example, I would like...
I propose to add the following trait to support perfect power checking (especially perfect square checking) ``` pub trait ExactRoots : Roots + Pow { fn nth_root_exact(&self, n: u32) ->...
As far as I can tell, there currently isn't a trait which inherits all the bitwise operator traits, In the same way that e.g. `NumOps` inherits the traits for arithmetic...
Documented crate implementing the desired traits: https://crates.io/crates/min_max_traits One alternative is to have PrimNumeric type that would offer these constants.
Right now `Float` trait contains methods `min_value`, `max_value`, `floor`, `ceil`, `round`, `trunc`, `fract`, `abs` and `signum` that are also applicable to fixed point numbers. Separating these methods into one or...