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

Commit

Permalink
Trac #20053: modify behaviour of precision
Browse files Browse the repository at this point in the history
  • Loading branch information
cheuberg committed Mar 9, 2016
1 parent 713f05f commit b42bb05
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/sage/rings/asymptotic/asymptotic_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -3005,7 +3005,7 @@ def _singularity_analysis_(self, var, zeta, precision=None):
- ``zeta`` -- location of the singularity
- ``precision`` -- (default: ``None``) an integer. If ``None``, then
the default precision of the asymptotic ring is used.
the default precision of the parent of this expansion is used.
OUTPUT:
Expand All @@ -3025,6 +3025,14 @@ def _singularity_analysis_(self, var, zeta, precision=None):
sage: ex._singularity_analysis_(n, 1/4, precision=2)
1/sqrt(pi)*4^n*n^(-3/2) - 9/8/sqrt(pi)*4^n*n^(-5/2) + O(4^n*n^(-3))
If the parameter ``precision`` is omitted, the default precision
of the parent of this expansion is used. ::
sage: C.<T> = AsymptoticRing('T^QQ', QQ, default_prec=1)
sage: ex = 2 - 2*T^(-1/2) + 2*T^(-1) - 2*T^(-3/2) + O(T^(-2))
sage: ex._singularity_analysis_('n', 1/4)
1/sqrt(pi)*4^n*n^(-3/2) + O(4^n*n^(-5/2))
.. SEEALSO::
:meth:`AsymptoticRing.coefficients_of_generating_function`
Expand All @@ -3041,6 +3049,9 @@ def _singularity_analysis_(self, var, zeta, precision=None):
from misc import NotImplementedOZero
OZeroEncountered = False

if precision is None:
precision = self.parent().default_prec

result = 0
for s in self.summands:
try:
Expand Down

0 comments on commit b42bb05

Please sign in to comment.