num-traits icon indicating copy to clipboard operation
num-traits copied to clipboard

Numeric traits for generic mathematics in Rust

Results 114 num-traits issues
Sort by recently updated
recently updated
newest added

The current `to_be` functions require unsafe to get a slice out of them; the individual types now (since 1.32) have `to_be_bytes` that does not have that flaw. I suggest adding...

num-traits is somewhat of a _de facto_ stable crate. Since these traits are often found in the public API of other crates, we really want to avoid the sort of...

breaking change

The overflowing-related traits are not exported in `lib.rs` and currently need to be imported from `num_traits::ops::overflowing`; It would be nice to have that consistent with the remaining traits.

I believe `PrimInt` should imply `NumAssign` as all primitive integers have it.

breaking change

I wanted a trait to identify `NonZero*` integers (eg `NonZeroU32`) and my first thought was this crate. I didn't seem a trait for them. In my very specific use case,...

After Rust 1.32, the function `to__bytes` and `from__bytes` has [stabilizations](https://blog.rust-lang.org/2019/01/17/Rust-1.32.0.html#library-stabilizations).

I'd like to propose the following breaking change (to be added to #47): make the members of `FloatConst` be either associated consts (my preference) or `const fn`s, so that they...

breaking change

i want to provide type safe fixed point 256 bit type and force usage only of type safe ops, but cannot impl it using num trait as it requries unchecked...

While the trait is documented as a fused multiply-add, for integers it is not. For floats, the following works as expected as the operation is actually fused. ```rust let a...

In generic code I would like `Float` bound to be enough to use it where `MulAdd` is expected given there is `Float::mul_add`, so trait can always be implemented. Maybe even...