sympy__sympy-24562
Rational calc value error
Verdict: the fix is stated in the issue (Tier A).
Q = 1 gcd = 1 if not isinstance(p, SYMPY_INTS): p = Rational(p) Q *= p.q p = p.p else: p = int(p) if not isinstance(q, SYMPY_INTS): q = Rational(q) p *= q.q Q *= q.p else: Q *= int(q) q = Q
The text states the fix: “Q = 1 gcd = 1 if not isinstance(p, SYMPY_INTS): p = Rational(p) Q *= p.q p = p.p else: p = int(p) if not isinstance(q, SYMPY_INTS): q = Rational(q) p *= q.q Q *= q.p els…”
All SWE-bench Verified tasks · more sympy/sympy tasks · How the check works