mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Added get_real
interface
This commit is contained in:
parent
c449b9b02f
commit
d6ec0ef59b
Notes:
git
2020-09-07 20:08:35 +09:00
4 changed files with 20 additions and 0 deletions
|
@ -16,5 +16,12 @@ module TestRandomExt
|
|||
rnd = Bug::Random::Loop.new(1)
|
||||
assert_equal(1, rnd.rand(10))
|
||||
end
|
||||
|
||||
def test_real
|
||||
assert_equal(0.25, Bug::Random::Loop.new(1<<14).rand)
|
||||
assert_equal(0.50, Bug::Random::Loop.new(2<<14).rand)
|
||||
assert_equal(0.75, Bug::Random::Loop.new(3<<14).rand)
|
||||
assert_equal(1.00, Bug::Random::Loop.new(4<<14).rand)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue