RosettaCodeData/Task/Modular-exponentiation/Ruby/modular-exponentiation-2.rb

6 lines
208 B
Ruby
Raw Permalink Normal View History

2019-09-12 10:33:56 -07:00
require 'openssl'
2013-04-10 21:29:02 -07:00
a = 2988348162058574136915891421498819466320163312926952423791023078876139
b = 2351399303373464486466122544523690094744975233415544072992656881240319
m = 10 ** 40
2019-09-12 10:33:56 -07:00
puts a.to_bn.mod_exp(b, m)