mirror of
https://github.com/Z3Prover/z3
synced 2025-10-16 04:20:25 +00:00
na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
cf8b3a0788
commit
49a903c875
3 changed files with 16 additions and 5 deletions
|
@ -109,3 +109,14 @@ mod_interval<Numeral> mod_interval<Numeral>::operator&(mod_interval const& other
|
|||
return mod_interval::empty();
|
||||
return mod_interval(l, h);
|
||||
}
|
||||
|
||||
template<typename Numeral>
|
||||
Numeral mod_interval<Numeral>::closest_value(Numeral const& n) const {
|
||||
if (contains(n))
|
||||
return n;
|
||||
if (is_empty())
|
||||
return n;
|
||||
if (lo - n < n - hi)
|
||||
return lo;
|
||||
return hi - 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue