Skip to content

Commit 5c971ee

Browse files
committed
revert treating 1 / f and ~f the same
1 parent c3be848 commit 5c971ee

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/sage/rings/lazy_series.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
sage: f
5858
1 + z + 2*z^2 + 3*z^3 + 5*z^4 + 8*z^5 + 13*z^6 + O(z^7)
5959
sage: f^-1
60-
1 - z - z^2
60+
1 - z - z^2 + O(z^7)
6161
sage: f + f^-1
6262
2 + z^2 + 3*z^3 + 5*z^4 + 8*z^5 + 13*z^6 + O(z^7)
6363
sage: g = (f + f^-1)*(f - f^-1); g
@@ -3448,11 +3448,12 @@ def _div_(self, other):
34483448
sage: 1 / f
34493449
Traceback (most recent call last):
34503450
...
3451-
ZeroDivisionError: cannot divide by a series of positive valuation
3451+
ZeroDivisionError: cannot divide by 0
34523452
sage: L.options._reset()
34533453
"""
3454-
if self.is_one():
3455-
return ~other
3454+
# currently __invert__ and _div_ behave differently with
3455+
# respect to division by lazy power series of positive
3456+
# valuation, so we cannot call ~other if self.is_one()
34563457
if not other:
34573458
raise ZeroDivisionError("cannot divide by 0")
34583459

0 commit comments

Comments
 (0)