Modular inverse: Difference between revisions
Content added Content deleted
Basicgames (talk | contribs) |
(→{{header|Ruby}}: Added built-in method) |
||
Line 2,344: | Line 2,344: | ||
=> 1969 |
=> 1969 |
||
</pre> |
</pre> |
||
The OpenSSL module has modular inverse built in: |
|||
<syntaxhighlight lang="ruby">require 'openssl' |
|||
p OpenSSL::BN.new(42).mod_inverse(2017).to_i</syntaxhighlight> |
|||
=={{header|Run BASIC}}== |
=={{header|Run BASIC}}== |