Skip to content

LaurentPolynomialRing define the zero polynomial to have degree -1 which is ambiguous #37491

@GiacomoPope

Description

@GiacomoPope

Steps To Reproduce

sage: R = LaurentPolynomialRing(QQ, 3, 'x')
sage: x0, x1, x2 = R.gens()
sage: R.zero().degree()
-1
sage: R.zero().degree(x0)
-1
sage: R.zero().degree(x1)
-1
sage: R.zero().degree(x2)
-1
sage: (1/x0).degree(x0)
-1
sage: (1/x0).degree()
-1

Expected Behavior

The degree of 0 should be distinct from polynomials we can construct

Actual Behavior

The degree of 0 is -1, the same as 1/x0 or other similar polynomials.

Additional Information

For standard univariate and multivariate polynomial rings, the degree being -1 is essentially a nice trick in place of $-\infty$, but for Laurent polynomial rings where negative degree makes total sense, this ambiguity with zero is confusing.

One idea would be to instead have it return - infinity.

Environment

- **Sage Version**: SageMath version 10.3.rc0, Release Date: 2024-02-25

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions