Skip to main content

Mojo function

randn_float64

randn_float64(mean: Float64 = 0, standard_deviation: Float64 = 1) -> Float64

Returns a random Float64 sampled from a normal distribution.

Example:

from std.random import randn_float64, seed
seed()
var rnd = randn_float64(0.0, 1.0)
print(rnd)  # Random Float64 from Normal(0.0, 1.0)

Args:

  • mean (Float64): The mean of the distribution.
  • standard_deviation (Float64): The standard deviation of the distribution.

Returns:

Float64: A random Float64 sampled from Normal(mean, standard_deviation).

Was this page helpful?