summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_float.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb
index 099f9e3b10..30725e8395 100644
--- a/test/ruby/test_float.rb
+++ b/test/ruby/test_float.rb
@@ -271,6 +271,12 @@ class TestFloat < Test::Unit::TestCase
assert_raise(ZeroDivisionError, bug6048) { 42 % 0 }
end
+ def test_modulo4
+ assert_predicate((0.0).modulo(Float::NAN), :nan?)
+ assert_predicate((1.0).modulo(Float::NAN), :nan?)
+ assert_predicate(Float::INFINITY.modulo(1), :nan?)
+ end
+
def test_divmod2
assert_equal([1.0, 0.0], 2.0.divmod(2))
assert_equal([1.0, 0.0], 2.0.divmod((2**32).coerce(2).first))