[SCM] an open source computer algebra system branch, cleanedupstream, updated. 6125e540ca6d66c307958938a9d53b245507c323

Bernhard R. Link brlink at debian.org
Tue Apr 24 15:55:33 UTC 2012


The following commit has been merged in the cleanedupstream branch:
commit e14aa1af8875bf52eab749f18299dd19c2f4d07d
Author: Martin Lee <martinlee84 at web.de>
Date:   Wed Apr 4 12:12:15 2012 +0200

    fix: division by zero in extgcd

diff --git a/factory/cf_gcd.cc b/factory/cf_gcd.cc
index 817c524..dff5467 100644
--- a/factory/cf_gcd.cc
+++ b/factory/cf_gcd.cc
@@ -294,6 +294,18 @@ icontent ( const CanonicalForm & f )
 CanonicalForm
 extgcd ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & a, CanonicalForm & b )
 {
+  if (f.isZero())
+  {
+    a= 0;
+    b= 1;
+    return g;
+  }
+  else if (g.isZero())
+  {
+    a= 1;
+    b= 0;
+    return f;
+  }
 #ifdef HAVE_NTL
   if (isOn(SW_USE_NTL_GCD_P) && ( getCharacteristic() > 0 ) && (CFFactory::gettype() != GaloisFieldDomain)
   &&  (f.level()==g.level()) && isPurePoly(f) && isPurePoly(g))

-- 
an open source computer algebra system



More information about the debian-science-commits mailing list