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

Add `round_to_digit` method to `Float` trait. # Example usage ``` let full_float = 12.34567; let rounded_float = full_float.round_to_digit(2); assert_eq!(rounded_float, 12.35); ```

enhancement

All signed rust integer types has an `unsgined_abs` function, e.g. `(-7_i32).unsigned_abs() == 7_u32`, which is there to correctly handle `i32::MIN` (which cannot be negated as a `i32`). I suggest we...

enhancement

My project currently uses both `num_traits::FloatCore` and the `funty::Floating` traits, as neither have all the functionality that I need. I would like to drop the `funty` dependency, but this requires...

Is there a reason that `Float` doesn't have `FloatCore` and `Real` as super traits?

f128 and f16 are currently nightly-only. See [`f128`](https://doc.rust-lang.org/nightly/core/primitive.f128.html) and [`f16`](https://doc.rust-lang.org/nightly/core/primitive.f16.html).

Basically b024e1c3269226fafe0cf35a2d3ebc11862b9043 but for Saturating.

I have a use case where I convert to and from primitive, and I need to involve `NonZero*` types as well. Currently, I have a function that uses these traits...

1. `integer_decode` is implemented for `f128` by truncating the radix to its 64 most significant bits. See #98. 2. Because of precision limitations, `f128` tests under `no_std` and `libm` fail.