random.c : fix Random#rand not returning value

This commit is contained in:
leviongit
2025-05-04 03:43:25 +02:00
parent 202c213fe1
commit 98906d5ac9
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -243,7 +243,7 @@ static mrb_value
random_m_rand(mrb_state *mrb, mrb_value self)
{
rand_state *t = random_ptr(self);
random_rand_impl(mrb, t, self);
return random_rand_impl(mrb, t, self);
}
static mrb_value
+2 -2
View File
@@ -137,8 +137,8 @@ assert('Array#sample(random)') do
end
assert("Kernel#rand()") do
100.times {
assert_include(0.0..1.0, rand)
100.times {
assert_include(0.0..1.0, rand)
assert_include(0...100, rand(0...100))
assert_include(0...100, rand(100))
}