From: leah@... Date: 2021-01-03T19:35:19+00:00 Subject: [ruby-core:101891] [Ruby master Feature#6362] Modular exponentiation/inverse Issue #6362 has been updated by leahneukirchen (Leah Neukirchen). As of Python 3.8, this is supported by Python's pow function, which can take a mod argument, just like Ruby's. https://docs.python.org/3/library/functions.html#pow I therefore propose to add this feature as ``` n.pow(-1, m) ``` This currently throws an error (`Integer#pow() 1st argument cannot be negative when 2nd argument specified`), so should be possible to extend. ---------------------------------------- Feature #6362: Modular exponentiation/inverse https://bugs.ruby-lang.org/issues/6362#change-89732 * Author: MartinBosslet (Martin Bosslet) * Status: Assigned * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) ---------------------------------------- I'd like to ask your opinion about adding two methods for modular exponentiation/modular inverse to integer classes. Is this functionality too specific or would this be a welcome addition? -- https://bugs.ruby-lang.org/ Unsubscribe: