Are they both exactly the same?
e.g.
rand(100) #=> 12
and
Random.rand(100) #=> 12
Are they both exactly the same?
e.g.
rand(100) #=> 12
and
Random.rand(100) #=> 12
As the documentation for Random#rand mentions,
Unlike Kernel#rand, when max is a negative integer or zero, rand raises an ArgumentError.
Otherwise, they have the same behavior.