From 99aaee351e42ca0d823ca959241668dc2eb77df2 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 20 Nov 2010 03:04:59 +0000 Subject: * random.c (random_rand): get rid of overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_rand.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_rand.rb b/test/ruby/test_rand.rb index c3282cf804..5ff2fe5e68 100644 --- a/test/ruby/test_rand.rb +++ b/test/ruby/test_rand.rb @@ -379,6 +379,8 @@ END assert_in_delta(1.7151893663724195, r.rand(1.0...2.0), 0.0001, '[ruby-core:24655]') assert_in_delta(7.027633760716439, r.rand(1.0...11.0), 0.0001, '[ruby-core:24655]') assert_in_delta(3.0897663659937937, r.rand(2.0...4.0), 0.0001, '[ruby-core:24655]') + + assert_nothing_raised {r.rand(-Float::MAX..Float::MAX)} end def test_random_equal -- cgit v1.2.3