Issue #14259 has been updated by naruse (Yui NARUSE).

Backport changed from 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: REQUIRED to 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: DONE

ruby_2_5 r61629 merged revision(s) 61517.

----------------------------------------
Bug #14259: Integer#pow returns a Invalid result with a large modulo
https://bugs.ruby-lang.org/issues/14259#change-69406

* Author: mrkn (Kenta Murata)
* Status: Closed
* Priority: Normal
* Assignee: mrkn (Kenta Murata)
* Target version: 
* ruby -v: ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: DONE
----------------------------------------
```
irb(main):020:0> 12.pow(1, 10000000000)
=> 1
irb(main):021:0> 12.pow(1, 10000000001)
=> 1
irb(main):022:0> 12.pow(1, 10000000002)
=> 1
```

These result should be `12`.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>