This repository was archived by the owner on Jan 30, 2023. It is now read-only.
File tree 3 files changed +13
-3
lines changed
3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 1
- 0.7.26.sage-2020-04-03.p0
1
+ 0.7.26.sage-2020-04-03.p2
Original file line number Diff line number Diff line change 1
1
diff --git a/ginac/power.cpp b/ginac/power.cpp
2
2
--- a/ginac/power.cpp
3
3
+++ b/ginac/power.cpp
4
- @@ -920,10 +920,11 @@
4
+ @@ -920,10 +920,14 @@
5
5
const ex& e = m.recombine_pair_to_ex(elem);
6
6
if (e.is_positive())
7
7
prodseq.push_back(pow(e, exponent).expand(options));
8
8
- else if (e.info(info_flags::negative)) {
9
9
- prodseq.push_back(pow(-e, exponent).expand(options));
10
10
- possign = !possign;
11
11
- } else
12
+ + // we delete the following 'else if' clause because it can lead to
13
+ + // an infinite loop (see sagemath :trac:`30688`)
14
+ + // TODO: find a bug-free treatment of negative factors
12
15
+ // else if (e.info(info_flags::negative)) {
13
16
+ // prodseq.push_back(pow(-e, exponent).expand(options));
14
17
+ // possign = !possign;
15
18
+ // }
16
19
+ else
17
20
powseq.push_back(elem);
18
21
}
19
-
Original file line number Diff line number Diff line change @@ -4807,6 +4807,14 @@ cdef class Expression(CommutativeRingElement):
4807
4807
1/(x^2 + 2*x + 1)
4808
4808
sage: (((x-1)/(x+1))^2).expand()
4809
4809
x^2/(x^2 + 2*x + 1) - 2*x/(x^2 + 2*x + 1) + 1/(x^2 + 2*x + 1)
4810
+
4811
+ Check that :trac:`30688` is fixed::
4812
+
4813
+ sage: assume(x < 0)
4814
+ sage: sqrt(-x).expand()
4815
+ sqrt(-x)
4816
+ sage: ((-x)^(3/4)).expand()
4817
+ (-x)^(3/4)
4810
4818
"""
4811
4819
if side is not None :
4812
4820
if not is_a_relational(self ._gobj):
You can’t perform that action at this time.
0 commit comments