Skip to content

kojix2/randn.cr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

randn.cr

test Docs Latest

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      randn:
        github: kojix2/randn.cr
  2. Run shards install

Usage

require "randn"

r = Rand.new

# Generate a random number from a normal distribution
# with mean 0 and standard deviation 1
r.randn
# => 0.6308041689636543

# Generate a random number from a normal distribution
# with mean 10 and standard deviation 2
r.randn(10, 2)
# => 11.812242402689735

# missing methods are delegated to `Random` object in the Rand instance 
r.next_bool
# => true

Development

  • Fork this repository
  • Report bugs
  • Fix bugs and submit pull requests
  • Write, clarify, or fix documentation
  • Suggest or add new features

Contributing

  1. Fork it (https://github.com/kojix2/randn/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

MIT License

About

Generate a normally-distributed random number

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published