diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-05 20:40:12 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-05 20:40:12 +0000 |
commit | a697c8b61b74744a63f2e896b36207fadf52f766 (patch) | |
tree | 6ba434899742c31e4fa6884bb877faf6dc112103 /test/ruby | |
parent | 311d499f5e34c9ad65687d241f65c654393ad73b (diff) |
merge revision(s) 61517: [Backport #14259]
numeric.c: Fix Integer#pow with a large Fixnum modulo
* numeric.c: Fix Integer#pow with a large Fixnum modulo
[Bug #14259] [ruby-core:84562]
* test/ruby/test_numeric.rb: add assertions for reproducing this bug.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@61629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_numeric.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_numeric.rb b/test/ruby/test_numeric.rb index 02a6b8f4a8..6efc40320a 100644 --- a/test/ruby/test_numeric.rb +++ b/test/ruby/test_numeric.rb @@ -400,6 +400,11 @@ class TestNumeric < Test::Unit::TestCase 2120078484650058507891187874713297895455. pow(5478118174010360425845660566650432540723, 5263488859030795548286226023720904036518)) + + assert_equal(12, 12.pow(1, 10000000000), '[Bug #14259]') + assert_equal(12, 12.pow(1, 10000000001), '[Bug #14259]') + assert_equal(12, 12.pow(1, 10000000002), '[Bug #14259]') + assert_equal(17298641040, 12.pow(72387894339363242, 243682743764), '[Bug #14259]') end end |