Project

General

Profile

Actions

Feature #12508

closed

Integer#mod_pow

Added by metanest (Makoto Kishimoto) over 8 years ago. Updated almost 3 years ago.

Status:
Closed
Target version:
-
[ruby-core:76084]

Description

A new method Integer#mod_pow, power with modulo.

a.mod_pow(b, m) #=> (a**b) % m

Sometimes a**b becomes very large number, then naive
implementation may be unefficient. Fast implementation
is useful.
(with USE_GMP symbol, this implement uses mpz_powm() )

(see https://github.com/ruby/ruby/pull/1320 )


Related issues 1 (0 open1 closed)

Has duplicate Ruby master - Feature #11003: Fast modular exponentiationClosedmatz (Yukihiro Matsumoto)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0