-
-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-37513: Define the zero polynomial to have degree
-Infinity
for `…
…LaurentPolynomialRing` At the moment `LaurentPolynomialRing` computes the degree of the zero polynomial element to be `-1`, which is ambiguous as `R(1/x)` also has degree `-1`. This PR changes the behaviour for both univariate and multivariate `LaurentPolynomialRings` so the degree of the zero polynomial is `-Infinity`. This is a common definition for the zero polynomial. This PR has been made following the discussion on `sage-devel`: https://groups.google.com/g/sage-devel/c/XVz-4kqWuuo about exactly when the degree of the zero polynomial should be `-1`, `-Infinity` or undefined. ```py sage: R.<x> = LaurentPolynomialRing(ZZ) sage: R(1/x).degree() -1 sage: R.zero().degree() -Infinity sage: sage: R.<x, y> = LaurentPolynomialRing(ZZ) sage: R(1/x).degree() -1 sage: R.zero().degree() -Infinity ``` Fixes #37491 URL: #37513 Reported by: Giacomo Pope Reviewer(s): Giacomo Pope, Martin Rubey, Travis Scrimshaw
- Loading branch information
Showing
2 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters