On Thu, Oct 23, 2014 at 3:14 AM, Samuel Lelievre <[email protected]> wrote:
> There is a workaround which is to use > > (a-b).is_real_positive() > > The comparison should be fixed to use that. > I disagree, since this approach will yield a < b and b < a both False most of the time. Moreover, it will only work if K is either totally real or CM. We should have two codepaths, one for testing equality (which is fast and doesn't need to use approximation), one for testing inequality in the presence of an embedding (which must use the embedding) and one for testing inequality without an embedding. I'm not sure what the best approach would be in this last case; perhaps lexicographic based on the power basis? For elements of an order you could also use lexicographic based on the basis for the order, which might be different. David > Samuel > > Le mercredi 22 octobre 2014 19:13:15 UTC+2, Volker Braun a écrit : > >> The number field comparison returns ">" for any two non-equal numbers. >> Surely there is a good reason for that behavior? I found this by debugging >> polyhedra over number fields (http://trac.sagemath.org/ticket/17197). >> Obviously you can't have polyhedra if your comparison is not working: >> >> sage: K.<a> = NumberField(x^3 - 3*x + 8, embedding=-2.4920333) >> sage: a.n() >> -2.49203330117182 >> sage: a+1 > a >> True >> sage: a > a+1 >> True >> >> -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
