From: Christian Bauer Date: Fri, 4 Aug 2000 16:57:34 +0000 (+0000) Subject: - added check for normal((b*a-c*a)/(4-a)) bug X-Git-Tag: release_0-6-4~3 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=c384abe0f7e5b85eba987c3dc3d67f7da00f2e49 - added check for normal((b*a-c*a)/(4-a)) bug --- diff --git a/check/exam_paranoia.cpp b/check/exam_paranoia.cpp index be9d4774..6fe0f097 100644 --- a/check/exam_paranoia.cpp +++ b/check/exam_paranoia.cpp @@ -312,28 +312,22 @@ static unsigned exam_paranoia12(void) return result; } -// This one called numeric(0).inverse() in heur_gcd(). +// This one caused a division by 0 because heur_gcd() didn't check its +// input polynomials against 0. Fixed on Aug 4th 2000. static unsigned exam_paranoia13(void) { unsigned result = 0; - symbol a("a"), b("b"), c("c"); - - ex e = c - (b*a-c*a)/(4-a); - ex f; - ex d = (b*a-4*c)/(a-4); - try { - f = e.normal(); - if (!(f - d).expand().is_zero()) { - clog << "normal(" << e << ") returns " << f - << " instead of " << d << endl; - ++result; - } - } catch (const exception & err) { - clog << "normal(" << e << ") cought an exception: " - << err.what() << endl; - ++result; - } - return result; + symbol a("a"), b("b"), c("c"); + + ex e = (b*a-c*a)/(4-a); + ex f = e.normal(); + ex d = (c*a-b*a)/(a-4); + + if (!(f - d).expand().is_zero()) { + clog << "normal(" << e << ") returns " << f << " instead of " << d << endl; + ++result; + } + return result; } unsigned exam_paranoia(void)