Attributes
Members list
Type members
Classlikes
Boundary behavior for angles. Prefers max (π over -π) and treats -π ≡ π as equivalent.
Boundary behavior for angles. Prefers max (π over -π) and treats -π ≡ π as equivalent.
Note: This should be explicitly imported or defined where angles are used, as it overrides the default number behavior.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
Given instance for BigDecimal.
Given instance for BigDecimal.
Attributes
- Supertypes
- Self type
Given instance for Double.
Given instance for Int.
Given instance for Rational numbers. Requires the RationalFloor extension to be in scope.
Given instance for Rational numbers. Requires the RationalFloor extension to be in scope.
Attributes
- Supertypes
- Self type
Value members
Concrete methods
Normalize a value into a range using modular arithmetic (with explicit boundary behavior). This replaces the recursive modulate function with an efficient modulo-based approach.
Normalize a value into a range using modular arithmetic (with explicit boundary behavior). This replaces the recursive modulate function with an efficient modulo-based approach.
The behavior is controlled by:
- boundaryBehavior parameter: explicit boundary behavior (polarity and circular equivalence)
- inclusive parameter: context-dependent choice of whether both endpoints are valid
Value parameters
- boundaryBehavior
-
explicit boundary behavior for this normalization
- inclusive
-
if true, both min and max are valid; if false, max is excluded
- max
-
the maximum of the range
- min
-
the minimum of the range
- value
-
the value to normalize
Attributes
- Returns
-
the normalized value in the appropriate range
Normalize a value into a range using modular arithmetic (with implicit boundary behavior). This version uses implicit resolution to find the appropriate BoundaryBehavior.
Normalize a value into a range using modular arithmetic (with implicit boundary behavior). This version uses implicit resolution to find the appropriate BoundaryBehavior.
Value parameters
- inclusive
-
if true, both min and max are valid; if false, max is excluded
- max
-
the maximum of the range
- min
-
the minimum of the range
- value
-
the value to normalize
Attributes
- Returns
-
the normalized value in the appropriate range
Givens
Givens
Given instance for BigDecimal.
Given instance for BigDecimal.
Attributes
Given instance for Double.
Given instance for Double.
Attributes
Given instance for Int.
Given instance for Int.
Attributes
Given instance for Rational numbers. Requires the RationalFloor extension to be in scope.
Given instance for Rational numbers. Requires the RationalFloor extension to be in scope.