-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Unfortunately the library fails to evaluate roots of fourth-degree equations. Take this code for example:
use rustnomial::{Polynomial};
fn main() {
let poly = Polynomial::<f64>::new(vec![1.0, 1.0, 1.0, 1.0, 1.0]);
let roots = poly.roots();
match roots {
rustnomial::Roots::OnlyRealRoots(_) => {
println!("roots() returned `Only Real Roots`");
},
_ => {
println!("roots() returned some other type.");
}
}
}Running this with rustnomial = "0.2.0" prints:
roots() returned `Only Real Roots`
while in fact x^4 + x^3 + x^2 + x + 1 has no real roots. The vector V in OnlyRealRoots(V) is empty too.
Some other times, the library returns OnlyRealRoots(V) with V containing only real roots, skipping complex ones.
Maybe I'm missing something here, but my understanding was that the library should have returned ManyComplexRoots in these cases.
BTW, thanks for the nice package. I'm using it in an educational project.
Metadata
Metadata
Assignees
Labels
No labels