Opened 10 years ago

Closed 9 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, GitHub, GitLab) Commit: 3c9b48bff9ce413fef85fe62d1038913fcc4c3a7
Dependencies: #11506 Stopgaps:

Status badges


An error with division of infinities:

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

Change History (9)

comment:1 Changed 9 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


comment:2 Changed 9 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)

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 9 years ago by eviatarbach (previous) (diff)

comment:3 Changed 9 years ago by zimmerma

ok I revert my comment 1.


comment:4 Changed 9 years ago by vbraun_spam

Milestone: sage-6.1sage-6.2

comment:5 Changed 9 years ago by vbraun_spam

Milestone: sage-6.2sage-6.3

comment:6 Changed 9 years ago by pbruin

Dependencies: #11506

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

comment:7 Changed 9 years ago by pbruin

Authors: Peter Bruin
Branch: u/pbruin/14857-infinity_division
Commit: 3c9b48bff9ce413fef85fe62d1038913fcc4c3a7
Priority: majortrivial
Status: newneeds_review
Type: defecttask

Here is a doctest.

comment:8 Changed 9 years ago by jkeitel

Reviewers: Jan Keitel
Status: needs_reviewpositive_review

Looks good and works.

comment:9 Changed 9 years ago by vbraun

Branch: u/pbruin/14857-infinity_division3c9b48bff9ce413fef85fe62d1038913fcc4c3a7
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.