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

Commit

Permalink
add doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
mantepse committed Aug 31, 2022
1 parent 9124987 commit 610078f
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/sage/rings/lazy_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3306,7 +3306,26 @@ def derivative(self, *args):
sage: (1/(1-z)).derivative(z)
1 + 2*z + 3*z^2 + 4*z^3 + 5*z^4 + 6*z^5 + 7*z^6 + O(z^7)
TESTS::
TESTS:
Check the derivative of the logarithm:
sage: L.<z> = LazyLaurentSeriesRing(QQ)
sage: -log(1-z).derivative()
1 + z + z^2 + z^3 + z^4 + z^5 + z^6 + O(z^7)
Check that differentiation of 'exact' series with nonzero
constant works::
sage: L.<z> = LazyLaurentSeriesRing(ZZ)
sage: f = L([1,2], valuation=-2, constant=1)
sage: f
z^-2 + 2*z^-1 + 1 + z + z^2 + O(z^3)
sage: f.derivative()
-2*z^-3 - 2*z^-2 + 1 + 2*z + 3*z^2 + 4*z^3 + O(z^4)
Check that differentiation with respect to a variable other
than the series variable works::
sage: R.<q> = QQ[]
sage: L.<z> = LazyLaurentSeriesRing(R)
Expand Down

0 comments on commit 610078f

Please sign in to comment.