On Thu, May 15, 2008 at 4:23 PM, David Joyner <[EMAIL PROTECTED]> wrote: > > I'm not disagreeing but want to point out one difference. > RR is an ordered field and this fact is used to differentiate between > i and -i. However, a finite field such as GF(5) is not, so there is > some ambiguity to i. It seems to me that this should be resolved somehow. >
In general in Sage when one explicitly does R( foo ) then the rule is "make an element of R out of foo if at all possible". The result doesn't have to be at all canonical. In sharp contrast, when you do R._coerce_(foo) the rule is "make an element in R from foo *only* if you can do so in a canonical way that extends to a morphism from the parent of foo". The above discussion is about GF(5)(sqrt(-1)), and according to the above general rule it is fine to define this. But definitely do not define GF(5)._coerce_(sqrt(-1)). Please see the programming guide, "The Sage Rules and Conventions for Coercion and Arithmetic" http://www.sagemath.org/doc/html/prog/node17.html for more details. William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---