Skip to content

Comments

Thinzero; close issue #623#624

Open
jverzani wants to merge 2 commits intoJuliaMath:masterfrom
jverzani:thinzero
Open

Thinzero; close issue #623#624
jverzani wants to merge 2 commits intoJuliaMath:masterfrom
jverzani:thinzero

Conversation

@jverzani
Copy link
Member

This addresses issue #623 by incorporating two new functions that can be overridden: iscoeffzero and iscoeffone which default to iszero and isone. With this, we have:

julia> using Polynomials

julia> using IntervalArithmetic

julia> a = interval(-1,1); z = interval(0,0)
[0.0, 0.0]_com

julia> p = Polynomial([a,z,a])
ERROR: ArgumentError: `==` is purposely not supported for overlapping non-thin intervals. See instead `isequal_interval`

julia> Polynomials.iscoeffzero(x::Interval) = isthinzero(x)

julia> Polynomials.iscoeffone(x::Interval) = isthinone(x)

julia> p = Polynomial([a,z,a])
Polynomial([-1.0, 1.0]_com + [-1.0, 1.0]_com*x^2)

julia> p*p
Polynomial([-1.0, 1.0]_com + [-2.0, 2.0]_com*x^2 + [-1.0, 1.0]_com*x^4)

@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 69.23077% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.70%. Comparing base (7c05f02) to head (52a21b4).

Files with missing lines Patch % Lines
src/contrib.jl 40.00% 3 Missing ⚠️
...ontainer-types/mutable-dense-laurent-polynomial.jl 66.66% 2 Missing ⚠️
src/show.jl 50.00% 2 Missing ⚠️
...mial-container-types/immutable-dense-polynomial.jl 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #624      +/-   ##
==========================================
- Coverage   76.75%   76.70%   -0.05%     
==========================================
  Files          37       37              
  Lines        4065     4070       +5     
==========================================
+ Hits         3120     3122       +2     
- Misses        945      948       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ViralBShah
Copy link
Member

ViralBShah commented Feb 23, 2026

@jverzani Do you have commit access to this repo? Just wanted to check and give you if you don't already have it.

EDIT: I notice you do already have access.

@jverzani
Copy link
Member Author

jverzani commented Feb 23, 2026

Thanks for checking @ViralBShah I do have access. Here I was waiting to see if the person who asked for this change had any thoughts on the implementation before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants