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: |

### 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 9 years ago by

### comment:2 Changed 9 years ago by

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.

### comment:4 Changed 9 years ago by

Milestone: | sage-6.1 → sage-6.2 |
---|

### comment:5 Changed 9 years ago by

Milestone: | sage-6.2 → sage-6.3 |
---|

### comment:6 Changed 9 years ago by

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

Authors: | → Peter Bruin |
---|---|

Branch: | → u/pbruin/14857-infinity_division |

Commit: | → 3c9b48bff9ce413fef85fe62d1038913fcc4c3a7 |

Priority: | major → trivial |

Status: | new → needs_review |

Type: | defect → task |

Here is a doctest.

### comment:8 Changed 9 years ago by

Reviewers: | → Jan Keitel |
---|---|

Status: | needs_review → positive_review |

Looks good and works.

### comment:9 Changed 9 years ago by

Branch: | u/pbruin/14857-infinity_division → 3c9b48bff9ce413fef85fe62d1038913fcc4c3a7 |
---|---|

Resolution: | → fixed |

Status: | positive_review → closed |

**Note:**See TracTickets for help on using tickets.

note also that

`limit`

returns "infinities" from the SymbolicRing? and not from the InfinityRing?, whereas it takes as input elements from the InfinityRing?:As a consequence, the equality

`a==b`

does not return True:Paul