#10064: -1 in expression "is_positive".
------------------------+---------------------------------------------------
Reporter: fmaltey | Owner: burcin
Type: defect | Status: new
Priority: major | Milestone: sage-4.6
Component: calculus | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------+---------------------------------------------------
Changes (by burcin):
* milestone: => sage-4.6
Comment:
Simpler example:
{{{
sage: (I*I)._is_positive()
True
sage: I*I
-1
}}}
The `is_positive()` test in pynac is at line 923 in numeric.cpp:
{{{
case PYOBJECT:
n = is_real() && (PyObject_Compare(v._pyobject, ZERO) > 0);
if (PyErr_Occurred())
py_error("is_positive");
return n;
}}}
We use the python comparison. Unfortunately, this doesn't work as expected
for number field elements:
{{{
sage: m = (I*I).pyobject()
sage: m.parent()
Number Field in I with defining polynomial x^2 + 1
sage: m > 0
True
sage: m
-1
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10064#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
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.