8 releases

0.0.8 Jan 24, 2025
0.0.7 Jan 21, 2025

#749 in Data structures

Download history 350/week @ 2025-01-12 287/week @ 2025-01-19 26/week @ 2025-01-26 9/week @ 2025-02-02

672 downloads per month
Used in ggmath

MIT license

48KB
1K SLoC

Splits the Rust number API and hierarchy into traits, with a cleaner design than the num crate.

The design of this crate follows these rules:

  • the Num trait isn't restricted to primitives, doesn't require representing values such as 0 or 1, and is only restricted to representing abstract numbers meaning no measurement units.

  • the Prim, SignedPrim, UnsignedPrim, Int, UInt, SInt, and Float traits are restricted to primitives, but allow non std types to impl 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 current state of this crate is using it for different projects and modifying the design until it hardens, so until then every version will have breaking changes.

Dependencies

~205–640KB
~15K SLoC