Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
fix pynac gcd(p,1)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveWitteMorris authored and mkoeppe committed Sep 26, 2021
1 parent 52915b6 commit 77bf8ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sage/symbolic/ginac/numeric.cpp
Expand Up @@ -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())
Expand All @@ -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:
Expand Down

0 comments on commit 77bf8ce

Please sign in to comment.