Skip to content

Commit 767fb0f

Browse files
committed
Fix GCD normalisation in Decimal->Fraction coercion.
1 parent 4f32c16 commit 767fb0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/quicktions.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,9 @@ cdef class Fraction:
515515
if sign:
516516
digits = -digits
517517
if exp >= 0:
518-
return _fraction_from_coprime_ints(digits * pow10(exp), None, cls)
518+
return _fraction_from_coprime_ints(digits * pow10(exp), 1, cls)
519519
else:
520-
return _fraction_from_coprime_ints(digits, pow10(-exp), cls)
520+
return cls(digits, pow10(-exp))
521521

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

0 commit comments

Comments
 (0)