-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: univariate polynomial rings over zero rings #1911
base: master
Are you sure you want to change the base?
Conversation
maybe this one here first, then I could improve #1910 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1911 +/- ##
==========================================
- Coverage 88.17% 88.17% -0.01%
==========================================
Files 120 120
Lines 30298 30301 +3
==========================================
+ Hits 26716 26718 +2
- Misses 3582 3583 +1 ☔ View full report in Codecov by Sentry. |
@@ -200,7 +200,7 @@ number_of_generators(R::PolyRing) = 1 | |||
|
|||
iszero(a::PolynomialElem) = length(a) == 0 | |||
|
|||
isone(a::PolynomialElem) = length(a) == 1 && isone(coeff(a, 0)) | |||
isone(a::PolynomialElem) = length(a) <= 1 && isone(coeff(a, 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does coeff(a, 0)
even work for length(a) == 0
or does that error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it works. This is part of the interface https://nemocas.github.io/AbstractAlgebra.jl/stable/poly_interface/#Basic-manipulation-of-rings-and-elements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
I will keep the caching of triviality for now. We can remove it later if we want. |
Co-authored-by: Max Horn <[email protected]>
No description provided.