-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
I found a situation where the library returns an incorrect result of multiplication...
use algebraics::prelude::*;
use algebraics::RealAlgebraicNumber as N;
fn main() {
let v = N::from(5).pow((1, 2)) / N::from(4) - N::from(1) / N::from(4);
println!("{v:?}");
// RealAlgebraicNumber { minimal_polynomial: -1 + 2*X + 4*X^2, interval: DyadicFractionInterval { lower_bound_numer: -1, upper_bound_numer: 3, log2_denom: 1 } }
// This polynomial has a root at 0.30901.. which is the correct answer
println!("{:?}", &v * &v);
// RealAlgebraicNumber { minimal_polynomial: 1 + 4*X, interval: DyadicFractionInterval { lower_bound_numer: -1, upper_bound_numer: 0, log2_denom: 0 } }
// This polynomial has only one root at -0.25 which is the wrong answer
}
This happens on the latest commit as well as on the crates.io version
Metadata
Metadata
Assignees
Labels
No labels