Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
Fixed a BigDecimal incompatibility (closes #3).
Browse files Browse the repository at this point in the history
  • Loading branch information
artob committed Mar 20, 2013
1 parent 99cd7c7 commit b136697
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rsa/math.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def self.prime?(n)
# @see http://en.wikipedia.org/wiki/Coprime
# @see http://mathworld.wolfram.com/RelativelyPrime.html
def self.coprime?(a, b)
gcd(a, b).equal?(1)
egcd = self.egcd(a, b)
(a*egcd[0] + b*egcd[1]).eql?(1)
end

##
Expand Down

0 comments on commit b136697

Please sign in to comment.