diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_numeric.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_numeric.rb b/test/ruby/test_numeric.rb index b5486d387c..0593cb535d 100644 --- a/test/ruby/test_numeric.rb +++ b/test/ruby/test_numeric.rb @@ -200,6 +200,14 @@ class TestNumeric < Test::Unit::TestCase assert_nil(a <=> :foo) end + def test_float_round_ndigits + bug14635 = "[ruby-core:86323]" + f = 0.5 + 31.times do |i| + assert_equal(0.5, f.round(i+1), bug14635 + " (argument: #{i+1})") + end + end + def test_floor_ceil_round_truncate a = Class.new(Numeric) do def to_f; 1.5; end |
