DynamicPolynomials.jl
DynamicPolynomials.jl copied to clipboard
Overload // for creating rational polynomials
I was expecting this to work:
julia> using DynamicPolynomials
julia> @polyvar x
(x,)
julia> x//2
ERROR: MethodError: no method matching //(::Variable{DynamicPolynomials.Commutative{DynamicPolynomials.CreationOrder}, Graded{LexOrder}}, ::Int64)
The function `//` exists, but no method is defined for this combination of argument types.
Closest candidates are:
//(::Integer, ::Integer)
@ Base rational.jl:84
//(::Rational, ::Integer)
@ Base rational.jl:86
//(::Complex, ::Real)
@ Base rational.jl:100
...
Stacktrace:
[1] top-level scope
@ REPL[4]:1
Do you want a fraction of polynomials or a polynomial with rational coefficients ?
Polynomial with rational coefficients
I agree it's the expected behavior, it shouldn't be too hard too hard to make it work.