JuliaMath / JuliaMath/Polynomials.jl

Breaking change introduced by #487

Open
#493 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
320
Forks
80
Avg merge
8h 46m
Merged PRs (30d)
3

Description

This PR introduced a breaking change
- https://github.com/JuliaMath/Polynomials.jl/pull/487

more specifically,
> Uses T[] for the coefficients of a 0 polynomial, not T[0], which requires zero(T). This led to some fixes on evaluation and changed some tests

This broke downstream use in ControlSystems.jl. The change does not really make total sense to me, these two polynomials should have the same number of coefficients, they only differ in their numerical values
```
julia> Polynomial(1).coeffs
1-element Vector{Int64}:
1

julia> Polynomial(0).coeffs
Int64[]
```

0 is a coefficient after all and `0 != nothing`. In particular since a 0 is returned for the 0:th degree coefficient in this case, introducing an inconsistency
```julia
julia> Polynomial([0,1])
Polynomial(x)

julia> Polynomial([0,1]).coeffs
2-element Vector{Int64}:
0
1
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.