class Faker::Number

def normal(mean: 1, standard_deviation: 1)

Returns:
  • (Float) -

Parameters:
  • standard_deviation (Numeric) --
  • mean (Integer) --
def normal(mean: 1, standard_deviation: 1)
  theta = 2 * Math::PI * rand
  rho = Math.sqrt(-2 * Math.log(1 - rand))
  scale = standard_deviation * rho
  mean + scale * Math.cos(theta)
end