Crate numaxiom

Crate numaxiom 

Source
Expand description

Const-friendly numeric traits for expressing ranges, signs, constants, and basic operations at the type level. Designed to stay lightweight and usable in no_std contexts.

Modules§

one
two
zero

Traits§

Abs
Absolute value helper.
Acos
Arccosine helper.
AnySign
Marker trait for types that can represent both negative and positive values (including zero). Implementers must ensure the type’s domain includes negative, zero, and positive values.
AnySignInfinity
Provides an unsigned infinity value via a method.
AnySignInfinityConst
Provides an unsigned infinity constant.
Asin
Arcsine helper.
Atan
Arctangent helper.
Atan2
Two-argument arctangent helper.
Cbrt
Cube root helper.
Ceil
Ceil helper.
CheckedAdd
Supplies a checked addition that returns None on overflow.
CheckedDiv
Supplies a checked division that returns None on division by zero or overflow.
CheckedMul
Supplies a checked multiplication that returns None on overflow.
CheckedNeg
Supplies a checked negation that returns None on overflow.
CheckedRem
Supplies a checked remainder that returns None on division by zero.
CheckedSub
Supplies a checked subtraction that returns None on underflow/overflow.
Clamp
Supplies a clamp helper for numeric types.
Cos
Cosine helper.
Epsilon
Provides machine epsilon as a method.
EpsilonConst
Provides machine epsilon as an associated constant.
Exp
Exponential helper.
Floor
Floor helper.
HasAnySignInfinity
Marker for types that can represent (any) infinity. Implementers must ensure positive or negative infinity is representable.
HasEpsilon
Marker for types that can represent machine epsilon. Implementers must ensure an epsilon value is representable.
HasMaxValue
Marker for types that can represent a maximum value. Implementers must ensure a well-defined maximum value exists.
HasMinValue
Marker for types that can represent a minimum value. Implementers must ensure a well-defined minimum value exists.
HasNan
Marker for types that can represent NaN. Implementers must ensure NaN is representable.
HasNegativeInfinity
Marker for types that can represent negative infinity. Implementers must ensure negative infinity is representable.
HasOne
Marker for types that can represent one. Implementers must ensure one is representable.
HasPositiveInfinity
Marker for types that can represent positive infinity. Implementers must ensure positive infinity is representable.
HasTwo
Marker for types that can represent two. Implementers must ensure two is representable.
HasZero
Marker for types that can represent zero. Implementers must ensure zero is representable.
Hypot
Hypotenuse helper.
Log
Natural logarithm helper.
Log2
Base-2 logarithm helper.
Log10
Base-10 logarithm helper.
LogBase
Logarithm with arbitrary base.
MaxValue
Provides the largest representable value for the type.
MaxValueConst
Provides the largest representable value for the type as a constant.
MinValue
Provides the smallest representable value for the type.
MinValueConst
Provides the smallest representable value for the type as a constant.
Nan
Provides a NaN value via a method.
NanConst
Provides a NaN value as an associated constant.
Negative
Marker trait for types that guarantee values strictly less than zero. Implementers must ensure all inhabited values are < 0.
NegativeInfinity
Provides a negative infinity value via a method.
NegativeInfinityConst
Provides a negative infinity constant.
NonAnySignInfinity
Marker for types that cannot represent infinity (positive or negative). Implementers must ensure infinities cannot be produced or represented.
NonEpsilon
Marker for types that do not expose a meaningful epsilon. Implementers must ensure an epsilon value is not provided or meaningful.
NonMaxValue
Marker for types that do not expose a meaningful maximum value. Implementers must ensure no well-defined maximum value is provided.
NonMinValue
Marker for types that do not expose a meaningful minimum value. Implementers must ensure no well-defined minimum value is provided.
NonNan
Marker for types that cannot represent NaN. Implementers must ensure NaN cannot be produced or represented.
NonNegative
Marker trait for types that guarantee values are greater than or equal to zero. Implementers must ensure all inhabited values are >= 0.
NonNegativeInfinity
Marker for types that cannot represent negative infinity. Implementers must ensure negative infinity cannot be produced or represented.
NonPositive
Marker trait for types that guarantee values are less than or equal to zero. Implementers must ensure all inhabited values are <= 0.
NonPositiveInfinity
Marker for types that cannot represent positive infinity. Implementers must ensure positive infinity cannot be produced or represented.
One
Provides the multiplicative identity (1) as a method.
OneConst
Provides the multiplicative identity (1) as an associated constant.
Positive
Marker trait for types that guarantee values strictly greater than zero. Implementers must ensure all inhabited values are > 0.
PositiveInfinity
Provides a positive infinity value via a method.
PositiveInfinityConst
Provides a positive infinity constant.
Pow
Exponentiation helper.
Reciprocal
Provides a multiplicative inverse operation for numeric types.
Root
Nth root helper.
Round
Round-to-nearest helper.
SaturatingAdd
Supplies a saturating addition.
SaturatingMul
Supplies a saturating multiplication.
SaturatingSub
Supplies a saturating subtraction.
Signum
Returns the sign of a value.
Sin
Sine helper.
Sqrt
Square root helper.
Tan
Tangent helper.
Trunc
Truncate toward zero.
Two
Provides the value 2 as a method.
TwoConst
Provides the value 2 as an associated constant.
Zero
Provides the additive identity (0) as a method.
ZeroConst
Provides the additive identity (0) as an associated constant.