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

Commit 6ea4bc6

Browse files
doctests and minor edits
1 parent 050b28e commit 6ea4bc6

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

build/pkgs/pynac/package-version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.7.26.sage-2020-04-03.p0
1+
0.7.26.sage-2020-04-03.p2

build/pkgs/pynac/patches/power_inf_loop.patch

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
diff --git a/ginac/power.cpp b/ginac/power.cpp
22
--- a/ginac/power.cpp
33
+++ b/ginac/power.cpp
4-
@@ -920,10 +920,11 @@
4+
@@ -920,10 +920,14 @@
55
const ex& e = m.recombine_pair_to_ex(elem);
66
if (e.is_positive())
77
prodseq.push_back(pow(e, exponent).expand(options));
88
- else if (e.info(info_flags::negative)) {
99
- prodseq.push_back(pow(-e, exponent).expand(options));
1010
- possign = !possign;
1111
- } 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
1215
+// else if (e.info(info_flags::negative)) {
1316
+// prodseq.push_back(pow(-e, exponent).expand(options));
1417
+// possign = !possign;
1518
+// }
1619
+ else
1720
powseq.push_back(elem);
1821
}
19-

src/sage/symbolic/expression.pyx

+8
Original file line numberDiff line numberDiff line change
@@ -4807,6 +4807,14 @@ cdef class Expression(CommutativeRingElement):
48074807
1/(x^2 + 2*x + 1)
48084808
sage: (((x-1)/(x+1))^2).expand()
48094809
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)
48104818
"""
48114819
if side is not None:
48124820
if not is_a_relational(self._gobj):

0 commit comments

Comments
 (0)