JuliaAlgebra / MultivariatePolynomials.jl

Multivariate polynomials interface
https://juliaalgebra.github.io/MultivariatePolynomials.jl/stable/
Other
135 stars 27 forks source link

polynomials over integers narrower than `Int` seem impossible or difficult to construct #277

Open nsajko opened 11 months ago

nsajko commented 11 months ago

With either TypedPolynomials or DynamicPolynomials:

julia> using TypedPolynomials

julia> @polyvar x
x

julia> coefficient_type(x + one(Bool))  # should be `Bool`
Int64

julia> coefficient_type(x + one(UInt16))  # should be `UInt16`
Int64
blegat commented 11 months ago

Indeed, the coefficient_type of a monomial is Int at the moment. We could change it to Bool to be consistent with LinearAlgebra.UniformScaling.