From 172d8f9b6eb3d0af7f451e505fd3a5c2e438215e Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 7 Nov 2012 07:03:50 +0000 Subject: * numeric.c (ruby_float_step): fix r37514: it yielded with NaN if the unit is infinity. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_float.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb index 2ac394465f..288101f129 100644 --- a/test/ruby/test_float.rb +++ b/test/ruby/test_float.rb @@ -585,6 +585,10 @@ class TestFloat < Test::Unit::TestCase assert_equal([5.0, 4.0, 3.0, 2.0], 5.0.step(1.5, -1).to_a) end + def test_step2 + assert_equal([0.0], 0.0.step(1.0, Float::INFINITY).to_a) + end + def test_step_excl 1000.times do a = rand -- cgit v1.2.3