X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=check%2Fexam_paranoia.cpp;h=9e6fb015f6b84e05be483d9dde9155e6df62a8e2;hp=61bd85debb427dd380b9c1fa3145a0292f140e44;hb=89d5356b4aa33cb4481575f9453f36c3404b015b;hpb=90ad10b58d02365a407b2d84d8b93e50030feaa5 diff --git a/check/exam_paranoia.cpp b/check/exam_paranoia.cpp index 61bd85de..9e6fb015 100644 --- a/check/exam_paranoia.cpp +++ b/check/exam_paranoia.cpp @@ -467,6 +467,18 @@ static unsigned exam_paranoia17() return test_cycl.get_free_indices().size(); } +// Bug in add::eval() could result in numeric terms not being collected into +// the overall coefficient. Fixed on Sep 22, 2010 +static unsigned exam_paranoia18() +{ + ex sqrt2 = sqrt(ex(2)); + ex e = 1+2*(sqrt2+1)*(sqrt2-1); + if ( e.real_part() != 3 ) { + clog << "real_part(1+2*(sqrt(2)+1)*(sqrt(2)-1)) failed to evaluate to 3\n"; + return 1; + } + return 0; +} unsigned exam_paranoia() { @@ -491,6 +503,7 @@ unsigned exam_paranoia() result += exam_paranoia15(); cout << '.' << flush; result += exam_paranoia16(); cout << '.' << flush; result += exam_paranoia17(); cout << '.' << flush; + result += exam_paranoia18(); cout << '.' << flush; return result; }