Skip to content

Commit

Permalink
refine precision before taking closest integral value.
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Apr 30, 2024
1 parent 2ad9f22 commit bc577b9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/math/polynomial/algebraic_numbers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2599,6 +2599,7 @@ namespace algebraic_numbers {
qm().dec(v);
}
else {
refine_until_prec(const_cast<numeral&>(a), 1);
bqm().floor(qm(), lower(a.to_algebraic()), v);
}
m_wrapper.set(b, v);
Expand All @@ -2611,6 +2612,7 @@ namespace algebraic_numbers {
qm().inc(v);
}
else {
refine_until_prec(const_cast<numeral&>(a), 1);
bqm().ceil(qm(), upper(a.to_algebraic()), v);
}
m_wrapper.set(b, v);
Expand Down

0 comments on commit bc577b9

Please sign in to comment.