From 77bf8ced66673b76ca9a28cfa9c55d8b0f55a58b Mon Sep 17 00:00:00 2001 From: Dave Witte Morris Date: Tue, 9 Mar 2021 23:19:53 -0700 Subject: [PATCH] fix pynac gcd(p,1) --- src/sage/symbolic/ginac/numeric.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/symbolic/ginac/numeric.cpp b/src/sage/symbolic/ginac/numeric.cpp index 22060441760..79044fb8d75 100644 --- a/src/sage/symbolic/ginac/numeric.cpp +++ b/src/sage/symbolic/ginac/numeric.cpp @@ -4408,6 +4408,8 @@ const numeric numeric::iquo(const numeric &b, numeric& r) const { const numeric numeric::gcd(const numeric &B) const { + // The gcd of two rational numbers p and q is the largest number d, + // such that p/d and q/d are integers (except that gcd(0,0) is 0). if (is_zero()) return B.abs(); if (B.is_zero()) @@ -4421,8 +4423,6 @@ const numeric numeric::gcd(const numeric &B) const b = B.negative(); else b = B; - if (a.is_one() or b.is_one()) - return *_num1_p; switch (a.t) { case LONG: