Skip to content

Commit

Permalink
Fix GCD normalisation in Decimal->Fraction coercion.
Browse files Browse the repository at this point in the history
  • Loading branch information
scoder committed Mar 19, 2023
1 parent 4f32c16 commit 767fb0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/quicktions.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,9 @@ cdef class Fraction:
if sign:
digits = -digits
if exp >= 0:
return _fraction_from_coprime_ints(digits * pow10(exp), None, cls)
return _fraction_from_coprime_ints(digits * pow10(exp), 1, cls)
else:
return _fraction_from_coprime_ints(digits, pow10(-exp), cls)
return cls(digits, pow10(-exp))

def is_integer(self):
"""Return True if the Fraction is an integer."""
Expand Down

0 comments on commit 767fb0f

Please sign in to comment.