Skip to content

Breaking change introduced by #487 #493

Open
@baggepinnen

Description

@baggepinnen

This PR introduced a breaking change

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> Polynomial([0,1])
Polynomial(x)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions