BoundaryBehavior

com.phasmidsoftware.number.core.inner.BoundaryBehavior
See theBoundaryBehavior companion object
trait BoundaryBehavior[X]

Typeclass that defines boundary behavior for a type when normalizing to a range. This captures the intrinsic properties of how a type handles range boundaries.

Type parameters

X

the numeric type

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def circularEquivalent: Boolean

Are the min and max boundaries equivalent (represent the same value)?

Are the min and max boundaries equivalent (represent the same value)?

Attributes

Returns

true if min ≡ max (like angles where -π ≡ π), false if they are distinct values (like regular numbers where 0 ≢ n)

def preferMax: Boolean

When a value lands exactly on a boundary (min or max) due to wrapping, which boundary should be preferred?

When a value lands exactly on a boundary (min or max) due to wrapping, which boundary should be preferred?

Attributes

Returns

true if max is preferred (like angles preferring π over -π), false if min is preferred (like regular numbers preferring 0 over n)