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

Most Rust primitives have a `BITS` associated const (with the number of bits used), but evidently there is no way to use this generically. I have a particular need for...

Basically the reverse request of #243 - Currently, `Real` implies `Copy`, which restricts it from being implemented for real-value types that use non-copy internals (for example, a type that represents...

breaking change

Hi! I've added my implementation of `Atomic` and `IntoAtomic`, I use them really often and they are quite similar to your traits so I think that they might be a...

I find the Num trait to be very useful when defining template functions over generic number types to help avoid long bounds lists. However I almost always need to add...

breaking change

Please, consider adding something like `PrimUint` = same as `PrimInt` but for unsigns.

I am working on a project using `uom` for quantity and unit aware numeric types. I have a piece of code that should abstract over `Length` and `Angle` and requires...

breaking change

Full log: https://buildd.debian.org/status/fetch.php?pkg=rust-num-traits&arch=mipsel&ver=0.2.15-1&stamp=1654173339&raw=0 ``` failures: ---- cast_float_to_int_edge_cases stdout ---- testing cast edge cases for f32 -> isize testing min -2147483648 vs. -2147483648 and -2147483904 testing max 2147483520 vs. 2147483520 and...

There exist traits for wrapping_add, wrapping_sub, wrapping_mul, wrapping_shl, wrapping_shr and wrapping_neg. Is there a reason why there isn't a trait for wrapping div and wrapping rem?

Picking up #103 from @flier to rebase and factor in feedback. Making a quick draft first