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

Commit 5f8941f

Browse files
author
Release Manager
committed
Trac #30798: fixing low_degree and degree documentation for symbolic expressions
because they work for Laurent-series-like exponents URL: https://trac.sagemath.org/30798 Reported by: chapoton Ticket author(s): Frédéric Chapoton Reviewer(s): Travis Scrimshaw
2 parents 2c3627a + a095196 commit 5f8941f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/sage/symbolic/expression.pyx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2817,10 +2817,9 @@ cdef class Expression(CommutativeRingElement):
28172817
"""
28182818
return is_a_infinity(self._gobj) and self._gobj.info(info_negative)
28192819

2820-
28212820
def is_square(self):
28222821
"""
2823-
Returns ``True`` if ``self`` is a perfect square.
2822+
Return ``True`` if ``self`` is a perfect square.
28242823
28252824
EXAMPLES::
28262825
@@ -2845,7 +2844,6 @@ cdef class Expression(CommutativeRingElement):
28452844

28462845
return obj.is_square()
28472846

2848-
28492847
def left_hand_side(self):
28502848
"""
28512849
If self is a relational expression, return the left hand side
@@ -6611,11 +6609,11 @@ cdef class Expression(CommutativeRingElement):
66116609

66126610
def low_degree(self, s):
66136611
"""
6614-
Return the exponent of the lowest nonpositive power of s in self.
6612+
Return the exponent of the lowest power of ``s`` in ``self``.
66156613
66166614
OUTPUT:
66176615
6618-
An integer ``<= 0``.
6616+
An integer
66196617
66206618
EXAMPLES::
66216619
@@ -6631,6 +6629,8 @@ cdef class Expression(CommutativeRingElement):
66316629
0
66326630
sage: (x^3+y).low_degree(x)
66336631
0
6632+
sage: (x+x**2).low_degree(x)
6633+
1
66346634
"""
66356635
cdef Expression ss = self.coerce_in(s)
66366636
sig_on()
@@ -6642,11 +6642,11 @@ cdef class Expression(CommutativeRingElement):
66426642

66436643
def degree(self, s):
66446644
"""
6645-
Return the exponent of the highest nonnegative power of s in self.
6645+
Return the exponent of the highest power of ``s`` in ``self``.
66466646
66476647
OUTPUT:
66486648
6649-
An integer ``>= 0``.
6649+
An integer
66506650
66516651
EXAMPLES::
66526652
@@ -6662,6 +6662,8 @@ cdef class Expression(CommutativeRingElement):
66626662
1
66636663
sage: (x^-3+y).degree(x)
66646664
0
6665+
sage: (1/x+1/x**2).degree(x)
6666+
-1
66656667
"""
66666668
cdef Expression ss = self.coerce_in(s)
66676669
sig_on()
@@ -7520,7 +7522,6 @@ cdef class Expression(CommutativeRingElement):
75207522
sig_off()
75217523
return new_Expression_from_GEx(self._parent, x)
75227524

7523-
75247525
def collect(Expression self, s):
75257526
"""
75267527
Collect the coefficients of ``s`` into a group.

0 commit comments

Comments
 (0)