Skip to content

Commit 50b1d02

Browse files
author
Release Manager
committed
gh-36185: src/sage/tests: fix another "Computational Math..." doctest One doctest for the Computational Math book fails for me, ``` Failed example: limit(f(t * cos(theta), t * sin(theta)) / t, t=0) Expected: cos(theta)^2/sin(theta) Got: -1/2*(sin(3*theta) + sin(theta))/(cos(2*theta) - 1) ``` These results are equivalent, and the ugly one simplifies to the pretty one. We add a full_simplify() to the test to support both outputs. The discrepancy is most likely due to the version of Giac installed on the system. URL: #36185 Reported by: Michael Orlitzky Reviewer(s): Kwankyu Lee
2 parents e7d2570 + bcd71cd commit 50b1d02

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/sage/tests/books/computational-mathematics-with-sagemath/graphique_doctest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,13 @@
215215
sage: plot3d(h, (u,-1,1), (v,-1,1), aspect_ratio=[1,1,1])
216216
Graphics3d Object
217217
218-
Sage example in ./graphique.tex, line 1833::
218+
Sage example in ./graphique.tex, line 1833. Sometimes the result
219+
needs to be simplified to obtain a nice short expression::
219220
220221
sage: f(x, y) = x^2 * y / (x^4 + y^2)
221222
sage: t, theta = var('t, theta')
222-
sage: limit(f(t * cos(theta), t * sin(theta)) / t, t=0)
223+
sage: result = limit(f(t * cos(theta), t * sin(theta)) / t, t=0)
224+
sage: result.full_simplify()
223225
cos(theta)^2/sin(theta)
224226
225227
Sage example in ./graphique.tex, line 1847::

0 commit comments

Comments
 (0)