use exact division when possible

This commit is contained in:
Luis Peñaranda 2013-11-26 17:13:26 -02:00
parent 0fa24f3c00
commit 68f368020d
1 changed files with 1 additions and 1 deletions

View File

@ -86,7 +86,7 @@ RS2_isolator_1(const CGAL::Polynomial<CGAL::Gmpq> &p):_polynomial(p){
mpz_t *coeffs=(mpz_t*)malloc((degree+1)*sizeof(mpz_t));
for(unsigned i=0;i<=degree;++i){
mpz_init(coeffs[i]);
mpz_div(coeffs[i],lcm,mpq_denref(p[i].mpq()));
mpz_divexact(coeffs[i],lcm,mpq_denref(p[i].mpq()));
mpz_mul(coeffs[i],coeffs[i],mpq_numref(p[i].mpq()));
}
// Call RS to solve the computed integer polynomial.