Rand
Inherits Reference < Object
Constructors
new(seed : UInt64, sequence = 0_u64)
Initializes an instance with the given seed and sequence.
Instance methods
randn(mean, std_dev) : Float64
Generates a random number from a normal distribution.
This method generates a random number from a normal distribution with a given mean and standard deviation std_dev.
r = Rand.new
r.randn(0, 1) # => 0.1.9288478880269821
randn
Generates a random number from a standard normal distribution.
This method uses the Box-Muller transform to generate a random number from a standard normal distribution. The generated number will have a mean of 0 and a standard deviation of 1.
r = Rand.new
r.randn # => 0.1.9288478880269821
random
SourceMacros
method_missing(call)
Source