Documentation ¶
Overview ¶
Package intrange holds distributions that accept and return ints
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Constant ¶
type Constant int
Constant implements Range as a poll which always returns the same integer.
func (Constant) EnforceRange ¶
EnforceRange on a constant must return the constant
func (Constant) Percentile ¶
Percentile can only return the constant itself
type Infinite ¶
type Infinite struct{}
Infinite is a immutable range which always polls math.MaxInt32
func (Infinite) EnforceRange ¶
EnforceRange for an Infinite returns Infinite
func (Infinite) Percentile ¶
Percentile can only return math.MaxInt32
type Range ¶
type Range interface { Poll() int Mult(float64) Range InRange(int) bool EnforceRange(int) int Percentile(float64) int }
Range represents the ability to poll a struct and return an integer, distributed over some range dependant on the implementing struct.
func NewConstant ¶
NewConstant returns a range which will always return the input constant
func NewInfinite ¶
func NewInfinite() Range
NewInfinite returns a range which will always return math.MaxInt32 and is unchangable.