User Tools

Site Tools




Documentation for the rb-gsl module can be found at

Documentation for the GSL is at

Create Random Numbers with Given Distribution

#!highlight ruby
rng = GSL::Rng.alloc # create a random number generator with default method and seed 0
GSL::Ran.gaussian(rng, 2.5) # draws random number from gaussian with mu = 0 and sigma = 2.5
ruby_cookbook.txt · Last modified: 2012/07/19 14:40 by mantis