Project

General

Profile

Feature #11003

Fast modular exponentiation

Added by venkatvb (venkatesh babu) over 5 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-core:<unknown>]

Description

I would like to suggest, implementing "fast Modular Exponentiation " (http://en.wikipedia.org/wiki/Modular_exponentiation) for fixnum class.
Eg: A function like pow(a, n, MOD) can be computed more efficiently than (a**n) % MOD


Related issues

Is duplicate of CommonRuby - Feature #12508: Integer#mod_powClosedmatz (Yukihiro Matsumoto)Actions
#1

Updated by mrkn (Kenta Murata) over 5 years ago

  • Description updated (diff)
#2

Updated by mrkn (Kenta Murata) over 5 years ago

  • Status changed from Open to Feedback
  • Assignee set to matz (Yukihiro Matsumoto)

I have two questions:

  • Do you have some concrete use cases in which this new feature is used?
  • Why don't you make a gem library to provide this feature? or Are there gem libraries providing it?
#3

Updated by mrkn (Kenta Murata) almost 3 years ago

Updated by mrkn (Kenta Murata) almost 3 years ago

  • Status changed from Feedback to Closed

The same function was accepted in #12508

Also available in: Atom PDF