summaryrefslogtreecommitdiff
path: root/test/ruby/test_float.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-05 07:36:28 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-05 07:36:28 +0000
commit0a5ac6a44809ec32ae6e836086708a64112bcfd0 (patch)
treebaff9ea570775fd1ad1cc0219977fa529665e910 /test/ruby/test_float.rb
parent6340d6336a41c00577f4c5c1060a779220681ca1 (diff)
Revert r33407; half-baked patch.
"* numeric.c (ruby_float_step): improve floating point calculations." git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_float.rb')
-rw-r--r--test/ruby/test_float.rb31
1 files changed, 0 insertions, 31 deletions
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb
index 531ff04fd6..e77b9e62e0 100644
--- a/test/ruby/test_float.rb
+++ b/test/ruby/test_float.rb
@@ -508,35 +508,4 @@ class TestFloat < Test::Unit::TestCase
sleep(0.1+0.1+0.1+0.1+0.1+0.1+0.1+0.1+0.1+0.1)
end
end
-
- def test_step
- 1000.times do
- a = rand
- b = a+rand*1000
- s = (b - a) / 10
- assert_equal(11, (a..b).step(s).to_a.length)
- end
-
- assert_equal(11, (1.0..(1.0+1E-15)).step(1E-16).to_a.length)
-
- (1.0..12.7).step(1.3).each do |n|
- assert_operator(n, :<=, 12.7)
- end
- end
-
- def test_step_excl
- 1000.times do
- a = rand
- b = a+rand*1000
- s = (b - a) / 10
- assert_equal(10, (a...b).step(s).to_a.length)
- end
-
- assert_equal([1.0, 2.9, 4.8, 6.699999999999999], (1.0...6.8).step(1.9).to_a)
-
- e = 1+1E-12
- (1.0 ... e).step(1E-16) do |n|
- assert_operator(n, :<, e)
- end
- end
end