Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overload // for creating rational polynomials #167

Open
dlfivefifty opened this issue Nov 26, 2024 · 3 comments
Open

Overload // for creating rational polynomials #167

dlfivefifty opened this issue Nov 26, 2024 · 3 comments

Comments

@dlfivefifty
Copy link

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
@blegat
Copy link
Member

blegat commented Nov 26, 2024

Do you want a fraction of polynomials or a polynomial with rational coefficients ?

@dlfivefifty
Copy link
Author

Polynomial with rational coefficients

@blegat
Copy link
Member

blegat commented Nov 26, 2024

I agree it's the expected behavior, it shouldn't be too hard too hard to make it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants