mendicant-original / ruby

The Ruby Programming Language
http://www.ruby-lang.org/
Other
19 stars 8 forks source link

Improve Random docs #3

Open gjp opened 13 years ago

gjp commented 13 years ago

I'll have a go at clarifying this one.

gjp commented 13 years ago

Kernel.rand behaves differently from Random.rand in counter-intuitive ways. I'm not sure if I'll be doing people a favor by documenting the corner cases:

ruby-1.9.3-rc1 :024 > rand(1.9) => 0 # always!

ruby-1.9.3-rc1 :031 > rand(-0.1) => 0.9186990608553834