| Crates.io | num-t |
| lib.rs | num-t |
| version | 3.0.0 |
| created_at | 2025-04-25 21:55:32.871925+00 |
| updated_at | 2025-04-26 11:56:50.296923+00 |
| description | Num |
| homepage | |
| repository | https://github.com/frewsxcv/num-t |
| max_upload_size | |
| id | 1649558 |
| size | 23,704 |
Num<T>: Associate arbitrary types with numeric types
This crate provides the Num<Number, Type> struct, which allows you to associate an arbitrary type Type with a numeric value Number. This can be useful for creating strongly-typed numeric values, preventing mixing of different units or concepts in calculations.
Num<Number, Type> wraps a numeric type Number and uses a std::marker::PhantomData<Type> to carry the type information without adding runtime overhead.
It implements many standard traits, including:
Clone, Copy, DefaultFrom<Scalar>PartialOrd, PartialEq, EqAdd, Sub, Mul, Div, Rem, AddAssign, etc.)FromStr, DisplaySumnum-traits crate: ToPrimitive, NumCast, Num, One, Zero, Float, Bounded, Signed, FromPrimitive.float_next_after: Implements float_next_after::NextAfter for Num when the underlying Number type also implements it.geo: Implements geo::GeoNum for Num when the underlying Number type also implements it.This crate is licensed under either of
at your option.