12 releases

new 0.0.12 Apr 12, 2025
0.0.11 Apr 11, 2025
0.0.8 Jan 24, 2025

#542 in Math

Download history 317/week @ 2025-01-11 292/week @ 2025-01-18 53/week @ 2025-01-25 9/week @ 2025-02-01 1/week @ 2025-02-08 6/week @ 2025-03-08 2/week @ 2025-03-15 257/week @ 2025-04-05

265 downloads per month
Used in ggmath

MIT license

56KB
1K SLoC

The newnum Rust crate is an alternative to the num crate that splits the Rust number API and hierarchy into traits, with a cleaner design than num.

The design of this crate follows these rules:

  • the Num trait isn't restricted to primitives, or to types that can represent specific common values (0, 1...).

  • the Prim, SignedPrim, UnsignedPrim, Int, UInt, SInt, and Float traits are restricted to primitives, but allow non std types to implement them as long as they follow primitive restrictions.

  • API traits (Round, Root, Trig...) aren't restricted to Num and are designed for non number support, for example <Angle as Trig>::Output = Ratio.

Development State

The crate is already very usable but makes breaking changes every version to improve the design.

Dependencies

~195–630KB
~15K SLoC