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

Commit

Permalink
allow O(0)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrenn committed Aug 26, 2015
1 parent c197b13 commit d759c8e
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/sage/rings/asymptotic/asymptotic_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -977,21 +977,16 @@ def O(self):
42*x^42 + x^10 + O(x^2)
sage: expr.O()
O(x^42)
TESTS::
sage: O(AR(0))
Traceback (most recent call last):
...
ValueError: Cannot build O(0).
0
sage: (2*x).O()
O(x)
.. SEEALSO::
:func:`sage.rings.power_series_ring.PowerSeriesRing`,
:func:`sage.rings.laurent_series_ring.LaurentSeriesRing`.
"""
if not self:
raise ValueError('Cannot build O(%s).' % (self,))
return sum(self.parent().create_summand('O', growth=element)
for element in self.summands.maximal_elements())

Expand Down

0 comments on commit d759c8e

Please sign in to comment.