Opened 8 years ago

Closed 6 years ago

#14857 closed task (fixed)

SR(infinity) / unsigned_infinity returns 0

Reported by: eviatarbach Owned by: AlexGhitza
Priority: trivial Milestone: sage-6.3
Component: algebra Keywords:
Cc: Merged in:
Authors: Peter Bruin Reviewers: Jan Keitel
Report Upstream: N/A Work issues:
Branch: 3c9b48b (Commits) Commit: 3c9b48bff9ce413fef85fe62d1038913fcc4c3a7
Dependencies: #11506 Stopgaps:

Description

An error with division of infinities:

sage: infinity / unsigned_infinity
ValueError: unsigned oo times smaller number not defined
sage: SR(infinity)/unsigned_infinity
0
sage: gamma(SR(-2))/gamma(-4)
0

Change History (9)

comment:1 Changed 7 years ago by zimmerma

note also that limit returns "infinities" from the SymbolicRing? and not from the InfinityRing?, whereas it takes as input elements from the InfinityRing?:

sage: a=+Infinity
sage: b=limit(x, x=a)
sage: type(a), a.parent()
(sage.rings.infinity.PlusInfinity, The Infinity Ring)
sage: type(b), b.parent()
(sage.symbolic.expression.Expression, Symbolic Ring)

As a consequence, the equality a==b does not return True:

sage: a==b
+Infinity == +Infinity

Paul

comment:2 Changed 7 years ago by eviatarbach

Hmm... But isn't that the case with anything in the Symbolic Ring? For example,

sage: SR(4) == 3
4 == 3
sage: type(limit(1/x, x=1))
<type 'sage.symbolic.expression.Expression'>

Calling bool with the equality returns a boolean:

sage: bool(a == b)
True

Calling .pyobject() on the result from limit would be sensible, I think. We have the following discrepancy now:

sage: type(diff(1))
<type 'sage.symbolic.expression.Expression'>
sage: type(integrate(0, x))
<type 'sage.rings.integer.Integer'>

It's very troubling how broken arithmetic and comparisons with infinities is at the moment, as shown in #11506.

Last edited 7 years ago by eviatarbach (previous) (diff)

comment:3 Changed 7 years ago by zimmerma

ok I revert my comment 1.

Paul

comment:4 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:5 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:6 Changed 7 years ago by pbruin

  • Dependencies set to #11506

Fixed by #11506; the same error is now raised in all three cases. We should just add a doctest.

comment:7 Changed 6 years ago by pbruin

  • Authors set to Peter Bruin
  • Branch set to u/pbruin/14857-infinity_division
  • Commit set to 3c9b48bff9ce413fef85fe62d1038913fcc4c3a7
  • Priority changed from major to trivial
  • Status changed from new to needs_review
  • Type changed from defect to task

Here is a doctest.

comment:8 Changed 6 years ago by jkeitel

  • Reviewers set to Jan Keitel
  • Status changed from needs_review to positive_review

Looks good and works.

comment:9 Changed 6 years ago by vbraun

  • Branch changed from u/pbruin/14857-infinity_division to 3c9b48bff9ce413fef85fe62d1038913fcc4c3a7
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.