#7160: comparison with quadratic number field elements needs work
-----------------------------+----------------------------------------------
Reporter: mhansen | Owner: davidloeffler
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.8
Component: number fields | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author: Mike Hansen
Merged: | Dependencies:
-----------------------------+----------------------------------------------
Comment(by davidloeffler):
Replying to [comment:7 was]:
> 2. This code raises a big red flag for me:
{{{
1704 from sage.rings.all import RR
1705 r = RR(right)
1706 l = RR(embedding(left))
1707 return cmp(l, r)
}}}
> My concern is that you're comparing to double (=53 bits) precision,
which is totally arbitrary. What if there is an embedding and cmp(left,
right) requires 54 bits of precision to sort out? I could probably with
some work construct a nasty example of this, where the above code just
gives totally the wrong answer. I guess we need to (1) compute to
precision of the embedding, and (2) if cmp(l,r)==0, then check something
more?
Isn't this what we have the QQbar class for?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7160#comment:9>
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.