Documentation
¶
Overview ¶
Package gorn (Go Random Numbers) provides a simple function for generating slices of random float64 values within configurable bounds.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRandoms ¶
GenerateRandoms returns a slice of numOutputRnds random float64 values in the range [lower, upper). By default, lower is 0 and upper is 100.
Use WithLowerBound and WithUpperBound to customise the range.
Returns an error if numOutputRnds <= 0 or if lower >= upper.
Types ¶
type Option ¶
type Option func(*config)
Option is a functional option for configuring GenerateRandoms.
func WithLowerBound ¶
WithLowerBound sets the lower bound (inclusive) for generated random numbers. The default lower bound is 0.
func WithUpperBound ¶
WithUpperBound sets the upper bound (exclusive) for generated random numbers. The default upper bound is 100.