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

Commit d96393c

Browse files
committed
apply trac 30688 patch infinite loop in pynac
commit fab5559 Author: Dave Witte Morris <[email protected]> Date: Sat Jan 30 12:41:57 2021 -0700 trac 30688 patch infinite loop in pynac
1 parent 91cb6fa commit d96393c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/sage/symbolic/ginac/power.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -920,10 +920,14 @@ ex power::expand(unsigned options) const
920920
const ex& e = m.recombine_pair_to_ex(elem);
921921
if (e.is_positive())
922922
prodseq.push_back(pow(e, exponent).expand(options));
923-
else if (e.info(info_flags::negative)) {
924-
prodseq.push_back(pow(-e, exponent).expand(options));
925-
possign = !possign;
926-
} else
923+
// we delete the following 'else if' clause because it can lead to
924+
// an infinite loop (see sagemath :trac:`30688`)
925+
// TODO: find a bug-free treatment of negative factors
926+
// else if (e.info(info_flags::negative)) {
927+
// prodseq.push_back(pow(-e, exponent).expand(options));
928+
// possign = !possign;
929+
// }
930+
else
927931
powseq.push_back(elem);
928932
}
929933

0 commit comments

Comments
 (0)