Closed agostonsipos closed 9 months ago
Hmm, maybe we can make
R = typeof(one(T)/1)
Which will make Integer go to Float, but keep Rational as is? The underlying solve_vander
only needs to have the type R
preserved under /
.
Would you want to make a PR and see if all the tests run?
I like the idea! Yes I will try doing a PR.
I was trying to use Polynomials for Base.Rational, and encountered an issue when running something like this:
The expected behavior is that a Polynomial with Rational coefficients is returned, and all steps are done with exact arithmetic.
Instead I get this error.
Note that for simpler tasks, a Polynomial is returned, but inexact arithmetic is being done in the process, just there is a smaller floating point error, so it can be converted back.
Doing some investigation, the issue is with the following function in
standard-basis.jl
:Changing the first line to
R = T
makes my example work correctly.Of course that is not the right solution, I'd recommend something like
not sure though if it should be more general than that though.