#5047: [with patch, positive review pending changes] comparing complex i raises
error
------------------------------+---------------------------------------------
Reporter: burcin | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone: sage-3.3
Component: basic arithmetic | Resolution:
Keywords: |
------------------------------+---------------------------------------------
Changes (by burcin):
* cc: was (added)
* summary: [with patch, needs review] comparing complex i raises error
=> [with patch, positive review pending
changes] comparing complex i raises error
Comment:
I ran into this when testing new printing code in pynac. ATM, pynac uses
the sign function, which is defined to be cmp(x, 0), to determine if it
should print a minus sign. Thus, we have the following:
{{{
sage: var('x',ns=1)
sage: i*x
<boom>
}}}
I somehow thought that the cmp function was not supposed to raise
exceptions, but googling shortly didn't turn up any evidence to support
this argument.
I would be ok to live with this fact, and try to figure out a better way
to handle the sign function, or printing in pynac.
BTW, the sign function is also mentioned here: #777
I give the attached patch a positive review, provided that doctests are
added to test for the new error message.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5047#comment:3>
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
-~----------~----~----~----~------~----~------~--~---