Project

General

Profile

Actions

Bug #14259

closed

Integer#pow returns an invalid result with large modulo

Added by mrkn (Kenta Murata) almost 7 years ago. Updated over 4 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]
[ruby-core:84562]

Description

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 results should be 12.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0