Skip to content

Commit 610078f

Browse files
committed
add doctests
1 parent 9124987 commit 610078f

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/sage/rings/lazy_series.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3306,7 +3306,26 @@ def derivative(self, *args):
33063306
sage: (1/(1-z)).derivative(z)
33073307
1 + 2*z + 3*z^2 + 4*z^3 + 5*z^4 + 6*z^5 + 7*z^6 + O(z^7)
33083308
3309-
TESTS::
3309+
TESTS:
3310+
3311+
Check the derivative of the logarithm:
3312+
3313+
sage: L.<z> = LazyLaurentSeriesRing(QQ)
3314+
sage: -log(1-z).derivative()
3315+
1 + z + z^2 + z^3 + z^4 + z^5 + z^6 + O(z^7)
3316+
3317+
Check that differentiation of 'exact' series with nonzero
3318+
constant works::
3319+
3320+
sage: L.<z> = LazyLaurentSeriesRing(ZZ)
3321+
sage: f = L([1,2], valuation=-2, constant=1)
3322+
sage: f
3323+
z^-2 + 2*z^-1 + 1 + z + z^2 + O(z^3)
3324+
sage: f.derivative()
3325+
-2*z^-3 - 2*z^-2 + 1 + 2*z + 3*z^2 + 4*z^3 + O(z^4)
3326+
3327+
Check that differentiation with respect to a variable other
3328+
than the series variable works::
33103329
33113330
sage: R.<q> = QQ[]
33123331
sage: L.<z> = LazyLaurentSeriesRing(R)

0 commit comments

Comments
 (0)