On Wed, Mar 11, 2009 at 11:29 AM, Ralf Hemmecke <r...@hemmecke.de> wrote: > > Some more oil for the fire... > > sage: K=NumberField(x^2+1, 'a'); K > Number Field in a with defining polynomial x^2 + 1 > sage: a = K.0 > sage: a > a > sage: a*a > -1 > sage: a<1 > False > sage: a>1 > True > sage: 1<a > False > sage: 1>a > True > sage: version() > 'Sage Version 3.3, Release Date: 2009-02-21' > > Do I do something wrong or is autocoercion doing something strange here? > In fact, I would have expected an error telling me that I cannot compare > an element of K with any other thing.
I don't think this has anything to do with coercion; it's just that comparison on number field elements is broken. In particular, for any two distinct number field elements a and b, a<b is False and a>b is True. sage: K.<a> = NumberField(x^2+1) sage: a < 2*a False sage: 2*a < a False sage: a > 2*a True sage: 2*a > a True Carl --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---