8 releases
0.0.8 | Jan 24, 2025 |
---|---|
0.0.7 | Jan 21, 2025 |
#749 in Data structures
672 downloads per month
Used in ggmath
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 as0
or1
, and is only restricted to representing abstract numbers meaning no measurement units. -
the
Prim
,SignedPrim
,UnsignedPrim
,Int
,UInt
,SInt
, andFloat
traits are restricted to primitives, but allow nonstd
types to impl them as long as they follow primitive restrictions. -
API traits (
Round
,Root
,Trig
...) aren't restricted toNum
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