From 2e2063fe16e2549123055f6f8aec5162cef01b99 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 22 Feb 2017 23:49:40 +0000 Subject: rational.c: infinity in power * rational.c (nurat_expt): return 0 due to overflow. [ruby-core:79686] [Bug #13242]: git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_rational.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_rational.rb b/test/ruby/test_rational.rb index c1e7d824d1..e0cb8db99e 100644 --- a/test/ruby/test_rational.rb +++ b/test/ruby/test_rational.rb @@ -959,6 +959,8 @@ class Rational_Test < Test::Unit::TestCase bug = '[ruby-core:79686] [Bug #13242]: Infinity due to overflow' x = EnvUtil.suppress_warning {4r**40000000} assert_predicate x, :infinite?, bug + x = EnvUtil.suppress_warning {(1/4r)**40000000} + assert_equal 0, x, bug end def test_positive_p -- cgit v1.2.3