| Crates.io | numaxiom |
| lib.rs | numaxiom |
| version | 0.0.2 |
| created_at | 2025-12-21 11:48:58.667502+00 |
| updated_at | 2026-01-02 07:04:57.248038+00 |
| description | Lightweight numeric marker traits for ranges/signs plus constants and ops; std by default, no_std optional. |
| homepage | https://github.com/numaxiom/numaxiom |
| repository | https://github.com/numaxiom/numaxiom |
| max_upload_size | |
| id | 1997852 |
| size | 88,309 |
⚠️ 0.0.x is pre-release/experimental; breaking changes are expected. See VERSIONS.md for status and compatibility details.
Numeric marker traits for ranges, signs, constants, and lightweight operations, usable in std and no_std environments. Not a num-traits shim: contracts are explicit, implementations document any variability (NaN/∞/rounding/panic).
Positive, Negative, NonPositive, NonNegative, AnySign, NonZero; domain markers NonNan / HasNan / NanConst; infinity markers (HasPositiveInfinity, HasNegativeInfinity, HasAnySignInfinity and Non* variants).Zero / One / Two (+ Has*, Non*, *Const), MinValue / MaxValue (+ const/marker), Epsilon (+ const/marker).Abs, Signum, Reciprocal, Sqrt, Root, Pow, Cbrt, Hypot, Exp, Log / Log2 / Log10 / LogBase, rounding (Floor / Ceil / Round / Trunc), trig (Sin / Cos / Tan + Asin / Acos / Atan / Atan2), Clamp, checked and saturating math.std. Works with no_std by disabling default features.libm for no_std float math symbols (opt-in; see ARCHITECTURE.md for details). Float ops are implemented for f32/f64 only when std or libm is enabled. Enabling libm inherits libm's MSRV (currently Rust 1.63 for 0.2.x; future libm releases may raise this).use core::ops::Add;
use numaxiom::{Abs, Clamp, NonNegative, One, Two, Zero};
fn normalize<T>(value: T) -> T
where
T: NonNegative + Abs + One + Two + Zero + Clamp + Add<Output = T>,
{
let denom = T::one() + T::two();
value.abs().clamp(T::zero(), denom)
}
Dual-licensed under MIT OR Apache-2.0. See the bundled license files.