Skip to content
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

breaking change for coeffs of Polynominal(0) ? #503

Open
johnnychen94 opened this issue May 25, 2023 · 2 comments
Open

breaking change for coeffs of Polynominal(0) ? #503

johnnychen94 opened this issue May 25, 2023 · 2 comments

Comments

@johnnychen94
Copy link

johnnychen94 commented May 25, 2023

I'm not sure if this is an intended change, will update the thread if I get more ideas on how the behavior gets affected.

v3.2.8:

julia> using Polynomials

julia> coeffs(Polynomial(0))
1-element Vector{Int64}:
 0

v3.2.9-3.2.12:

julia> using Polynomials

julia> coeffs(Polynomial(0))
Int64[]
@jverzani
Copy link
Member

Yes, there was a change here. The basic constructors always trimmed any trailing zeros, and the
zero polynomials were special cased. That was dropped so that zero(T) was not needed to make a zero polynomial. Does it effect anything that you were doing?

@johnnychen94
Copy link
Author

johnnychen94 commented May 25, 2023

Does it effect anything that you were doing?

Yep, when implementing conv or some loops, it would occasionally depend on length(coeffs(p)). I've already gotten a compat patch for this so not much to worry. I just opened this issue to see if there's a need to "fix something upstream" 😆

Please feel free to close this issue if this is an intentional change and you think there's no need to fix it.

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

No branches or pull requests

2 participants