Page 1 sur 1

poly1a[a₀, a₁, a₂, …, aₙ₋₁, aₙ] & poly1d[aₙ, aₙ₋₁, …, a₂, a₁, a₀]

Publié : mar. juin 26, 2018 4:31 am
par compsystems
Hello, a problem when working in polynomials as n-uplas, is that it is not known if they are ordered in ascending or descending order.

idea: add the prefixes (ascending , decreasing) to be able to differentiate them and internally interpret them without needing to verify external flag

P(x) = a₀·x⁰ + a₁·x¹ + a₂·x² + … + aₙ₋₁ ·xⁿ⁻¹ + aₙ· xⁿ
poly1a[a₀, a₁, a₂, …, aₙ₋₁, aₙ]

P(x) = aₙ·xⁿ + aₙ₋₁ ·xⁿ⁻¹+ … + a₂·x² + a₁·x¹ + a₀·x⁰
poly1d[aₙ, aₙ₋₁, …, a₂, a₁, a₀]

Re: poly1a[a₀, a₁, a₂, …, aₙ₋₁, aₙ] & poly1d[aₙ, aₙ₋₁, …, a₂, a₁, a₀]

Publié : mar. juin 26, 2018 4:46 am
par parisse
Inside Xcas, coefficients are always ordered by decreasing degree. poly1[...] is not really meant to be used in highschool, it's for advanced users who need efficient 1-d dense polynomial arithmetic.