Hi Nils, On 11 Feb., 20:25, Nils Bruin <nbr...@sfu.ca> wrote: > I'd say: return 0 if a=b=0 and some random non-zero field element > otherwise. That will teach people to write programs that depend on > properly defined mathematical concepts rather than implementation > details. (this is not a serious proposal for this particular case but > the principle of not going out of your way to fix arbitrary choices > and to avoid depending on them being made in a particular way has > served me well).
Yes and no. "Yes", because it is a bad idea to rely on choices that have no mathematical justification. "No", since it is a bad idea to *not* rely on canonical choices if one is in a situation that allows for a canonical choice. Here, we can argue: If a programmer writes code for principal ideal domains, then s/he is supposed to not rely on a particular choice of lcm/gcd -- because in a PID F, these notions are only defined up to a unit of F. However, if the programmer writes code for the fraction field, F, of PIDs, R, then one certainly is in a special situation. There is a mathematically sound way to define lcm/gcd uniquely up to a unit of R (not of F). So, the ambiguity is less, and it would be silly to not use the smaller ambiguity. I think this kind of argument holds in general, not only for gcd/lcm. Cheers, Simon -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org