Opened 10 years ago

Closed 9 years ago

# SR(infinity) / unsigned_infinity returns 0

Reported by: Owned by: eviatarbach AlexGhitza trivial sage-6.3 algebra Peter Bruin Jan Keitel N/A 3c9b48b 3c9b48bff9ce413fef85fe62d1038913fcc4c3a7 #11506

### 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
```

### 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
```

Paul

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

### comment:3 Changed 9 years ago by zimmerma

ok I revert my comment 1.

Paul

### comment:4 Changed 9 years ago by vbraun_spam

Milestone: sage-6.1 → sage-6.2

### comment:5 Changed 9 years ago by vbraun_spam

Milestone: sage-6.2 → sage-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 → u/pbruin/14857-infinity_division → 3c9b48bff9ce413fef85fe62d1038913fcc4c3a7 major → trivial new → needs_review defect → task

Here is a doctest.

### comment:8 Changed 9 years ago by jkeitel

Reviewers: → Jan Keitel needs_review → positive_review

Looks good and works.

### comment:9 Changed 9 years ago by vbraun

Branch: u/pbruin/14857-infinity_division → 3c9b48bff9ce413fef85fe62d1038913fcc4c3a7 → fixed positive_review → closed
Note: See TracTickets for help on using tickets.