#9480 closed defect (fixed)
Sage mixes Infinity and +Infinity
Reported by: | zimmerma | Owned by: | robertwb |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | coercion | Keywords: | infinity, equality |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
This is related to #8942. The limit function can output either
+Infinity
, -Infinity
, or Infinity
, the later
meaning a complex infinity. For example:
sage: limit(1/x, x=0, dir='above') +Infinity sage: limit(1/x, x=0, dir='below') -Infinity sage: limit(1/x, x=0) Infinity
However Sage does not distinguish +Infinity
and Infinity
:
sage: l1=limit(1/x, x=0, dir='above') sage: l2=limit(1/x, x=0, dir='below') sage: l3=limit(1/x, x=0) sage: l1==l3 True
Change History (9)
comment:1 Changed 11 years ago by
- Component changed from calculus to coercion
- Keywords infinity equality added
- Milestone set to sage-4.5.3
- Owner changed from burcin to robertwb
comment:2 Changed 9 years ago by
comment:3 Changed 8 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:4 Changed 8 years ago by
- Status changed from new to needs_review
in Sage 5.11 we get:
sage: l1=limit(1/x, x=0, dir='right'); l1 +Infinity sage: l2=limit(1/x, x=0, dir='left'); l2 -Infinity sage: l3=limit(1/x, x=0); l3 Infinity sage: bool(l1==l2), bool(l2==l3), bool(l3==l1) (False, False, False)
however the objects returned are in SR and not in the infinity
class:
sage: type(l1), l1.parent() (sage.symbolic.expression.Expression, Symbolic Ring) sage: p1=+Infinity sage: type(p1), p1.parent() (sage.rings.infinity.PlusInfinity, The Infinity Ring)
I propose to close that ticket, and open a new one about the above issue (or add it to an existing ticket).
Paul
comment:5 Changed 8 years ago by
comment:6 Changed 7 years ago by
- Status changed from needs_review to needs_info
No patch to review on this ticket...
Paul : when you want to close a ticket, you should set its milestone to wontfix/duplicate, say why on a comment, and change the status to positive_review
so that the release manager will see it.
Nathann
comment:7 Changed 7 years ago by
- Resolution set to fixed
- Status changed from needs_info to closed
in Sage 6.0 we get:
sage: l1=limit(1/x, x=0, dir='above') sage: l3=limit(1/x, x=0) sage: bool(l1==l3) False
thus the issue is fixed now, and I change the status to "fixed".
Paul
comment:8 Changed 7 years ago by
sorry when changing to "fixed" (which made more sense to me than invalid or wontfix) the status was changed automatically to "closed"...
Paul
comment:9 Changed 7 years ago by
- Milestone changed from sage-6.1 to sage-duplicate/invalid/wontfix
I also verified that it works in 6.1.beta2
.
This is more of a problem with the equality checking rules in Sage and the coercion system than symbolics, so I'm changing the component to coercion.
If the arguments compare equal when coerced to a common parent, Sage returns
True
for the equality. In this case, the coercion goes to theUnsignedInfinityRing
, where+Infinity
is mapped tounsigned_infinity
.BTW, isn't there an inconsistency in the capitalization of
Infinity
. Shouldn't it be lowercase according to Python conventions?