#1915: [with patch, needs some work] infinity doesn't behave well
----------------------+-----------------------------------------------------
Reporter: burcin | Owner: cwitty
Type: defect | Status: new
Priority: critical | Milestone: sage-3.1.3
Component: misc | Resolution:
Keywords: |
----------------------+-----------------------------------------------------
Changes (by jhpalmieri):
* summary: [with patch, needs review] infinity doesn't behave well =>
[with patch, needs some work] infinity doesn't
behave well
Comment:
Overall, I like this. However, and this is not entirely the fault of your
patch, I have an issue here. First, in the docs at the top of the file
infinity.py, oo is defined to be {{{UnsignedInfinityRing.0}}}, and then
later it is defined to be {{{InfinityRing.0}}}; however, oo is already
defined (in sage.all). It seems bad to define it (since it's already
defined), and it also makes the documentation really hard to read, since
as it currently stands, sometimes oo means (unsigned) infinity, and
sometimes it means +Infinity. If you're doing a quick skim (as I just
was), you can get really confused.
Furthermore, in a fresh copy of sage:
{{{
sage: InfinityRing.0 == oo
True
sage: UnsignedInfinityRing.0 == oo
True
sage: 1 / (UnsignedInfinityRing.0)
A number less than infinity
sage: 1 / oo
0
}}}
I don't like the fact that although these various infinities are ==, they
don't behave the same when they are denominators.
Perhaps this could be fixed by:
1. having your patch return 0 for quotients like {{{1 /
(UnsignedInfinityRing.0)}}} (or did you have a reason for not making {{{1
/ (UnsignedInfinityRing.0)}}} return 0?), and
2. not defining oo in the documentation, but instead verify in the
examples that {{{oo == UnsignedInfinityRing.0}}} and {{{oo ==
InfinityRing.0}}} both return True. (Or if the generator
{{{UnsignedInfinityRing.0}}} really needs a name in the docs, give it a
different one. Same for {{{InfinityRing.0}}}, so the two elements can be
easily distinguished when reading the docs.)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/1915#comment:2>
SAGE <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---