Factry Historian
...
Standard Library
rand
module "rand" tengo rand = import("rand") functions seed(seed int) uses the provided seed value to initialize the default source to a deterministic state exp float() => float returns an exponentially distributed float64 in the range (0, +math maxfloat64] with an exponential distribution whose rate parameter (lambda) is 1 and whose mean is 1/lambda (1) from the default source float() => float returns, as a float64, a pseudo random number in \[0 0,1 0) from the default source int() => int returns a non negative pseudo random 63 bit integer as an int64 from the default source intn(n int) => int returns, as an int64, a non negative pseudo random number in \[0,n) from the default source it panics if n <= 0 norm float() => float returns a normally distributed float64 in the range \[ math maxfloat64, +math maxfloat64] with standard normal distribution (mean = 0, stddev = 1) from the default source perm(n int) => \[int] returns, as a slice of n ints, a pseudo random permutation of the integers \[0,n) from the default source read(p bytes) => int/error generates len(p) random bytes from the default source and writes them into p it always returns len(p) and a nil error rand(src seed int) => rand returns a new rand that uses random values from src to generate other random values rand seed(seed int) uses the provided seed value to initialize the default source to a deterministic state exp float() => float returns an exponentially distributed float64 in the range (0, +math maxfloat64] with an exponential distribution whose rate parameter (lambda) is 1 and whose mean is 1/lambda (1) from the default source float() => float returns, as a float64, a pseudo random number in \[0 0,1 0) from the default source int() => int returns a non negative pseudo random 63 bit integer as an int64 from the default source intn(n int) => int returns, as an int64, a non negative pseudo random number in \[0,n) from the default source it panics if n <= 0 norm float() => float returns a normally distributed float64 in the range \[ math maxfloat64, +math maxfloat64] with standard normal distribution (mean = 0, stddev = 1) from the default source perm(n int) => \[int] returns, as a slice of n ints, a pseudo random permutation of the integers \[0,n) from the default source read(p bytes) => int/error generates len(p) random bytes from the default source and writes them into p it always returns len(p) and a nil error