On Wed, Jun 17, 2009 at 1:10 PM, Tim Lahey<tim.la...@gmail.com> wrote: > > > On Jun 17, 2009, at 7:05 AM, John Cremona wrote: > >> >> I think is is easier, both on the eye and for a beginner to >> understand: >> >> sage: x = polygen(ZZ) >> sage: f = 2*x**2 - x >> sage: f.factor() >> x * (2*x - 1) >> >> The effect of the first line is that polynomials in x are elements of >> the polynomial ring with integer coefficients. Note the difference >> when we switch to rational coeffs: >> >> sage: x = polygen(QQ) >> sage: f = 2*x**2 - x >> sage: f.factor() >> (2) * (x - 1/2) * x >> >> Here 2 is the "unit factor" amd the other two are irreducible >> polynomials normalised to be monic, which makes sense over a field. >> >> John Cremona >> > > Is there any particular reason why the x comes at the end instead of
The factors are sorted, I think in lex order, where x - 1/2 is internally [-1/2,1] and x is internally [0,1]. Notice that: sage: x=polygen(QQ) sage: f = 2*x**2 + x; factor(f) (2) * x * (x + 1/2) --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---