On Sun, Jul 19, 2009 at 9:04 AM, William Stein<wst...@gmail.com> wrote: > > > Please do not make the above change. It would be very inconsistent > with what happens for symbolic variables: > > sage: var('x,y,z,w') > sage: f = 1.0*x^2 - 1.0*y > sage: f.variables() > (x, y)
I'm not sure symbolic variables are consistent to start with: sage: SR(1.0) 1.00000000000000 sage: SR(1.0*x) x sage: SR(2.0*x) 2.00000000000000*x sage: SR(1.0*x+1.0) x + 1.00000000000000 This does not look promising. Printing should be consistent across similar elements of the same parent, and it's not. I would argue that, strictly speaking, the variable 'x' is not an element of the polynomial ring R[x]. The latter is defined as finite formal sums of the form a0 + a1*x + ... + an*x^n So x is not in R[x], but R(1)*x is. x is a formal variable/symbol, while R(1)*x is a polynomial. What I'm trying to get at is this: we can't have our cake and eat it too. If we agree that 1.0*x should be printed as 1.0000000000*x, and we want f.variables() to return x as an element of the polynomial ring, then it will be printed as 1.00000000000*x. If we make f.variables() return the formal variable x somehow, then we can always do R(x) to get the polynomial. I'm not saying that I think I have the correct solution to this, I'm just pointing out that symbolic expressions are printed almost as inconsistently as multivariate polynomials (and differently to univariate polynomials) so they might not be the right model to follow. Best, Alex -- Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne -- Australia -- http://www.ms.unimelb.edu.au/~aghitza/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---