End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Random.rand
Random.rand → float
Random.rand(max) → number
random.c
View on GitHub ↗
static VALUE
random_s_rand(int argc, VALUE *argv, VALUE obj)
{
VALUE v = rand_random(argc, argv, Qnil, rand_start(default_rand()));
check_random_number(v, argv);
return v;
}
No documentation available
Ruby version changes
-
3.0
-
Random::DEFAULTis deprecated since its value is now confusing and it is no longer global, useKernel.rand/Random.randdirectly, or create aRandominstance withRandom.newinstead. [Feature #17351]
-