On Fri, 1 Mar 2024 at 11:51, 'Martin R' via sage-devel <sage-devel@googlegroups.com> wrote: > On Friday 1 March 2024 at 12:15:36 UTC+1 John Cremona wrote: > On Fri, 1 Mar 2024 at 11:03, Dima Pasechnik <dim...@gmail.com> wrote: > > OTOH, setting the degree of 0 to be -oo has an obvious advantage: it > automaticlly gives mathematically correct degree of fg, by using > degree(fg)=degree(f)+degree(g), regardless of f or g being 0. And checking > the degree is (or at least ought to be) faster than comparing for equality to > 0. > > It's a little dangerous to talk of -oo being "mathematically correct", but I > have given this definition myself in undergraduate course (and for the reason > you give) so that's ok, especially as in Sage we do have -oo as a possible > return value and no requiremt for the value to always be of the same type > (e.g. Integer). > > I would rather say that "-1" is in some cases "mathematically incorrect", in > particular for Laurent polynomials :-)
What exactly is the "mathematically correct" meaning of "degree" for Laurent polynomials? I haven't seen other examples where this is defined except Matlab which defines it differently from Sage: https://uk.mathworks.com/help/wavelet/ref/laurentpolynomial.degree.html The Matlab definition is basically that deg(p(x)*x^m) = deg(p(x)). This means that for nonzero Laurent polynomials the degree is always nonnegative. Here deg(x^m) = 0 i.e. the degree of a unit is always 0. I haven't thought much about this but this definition of degree seems consistent with the notion of degree as a Euclidean function that can define Euclidean division. In the sympy polynomial code all uses of degree are in the polynomial division, gcd and factor code because the main use of degree is in defining division. Oscar -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAHVvXxQErjrcvnCKk4j4c5-F%3DZDQ%3D6LpZ1OycaqEtBBx7wGfPA%40mail.gmail.com.