Skip to content

Commit

Permalink
fix #2487
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
  • Loading branch information
NikolajBjorner committed Aug 15, 2019
1 parent d64dc93 commit 3074e2b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/api/c++/z3++.h
Original file line number Diff line number Diff line change
Expand Up @@ -1259,10 +1259,22 @@ namespace z3 {
inline expr pw(expr const & a, int b) { return pw(a, a.ctx().num_val(b, a.get_sort())); }
inline expr pw(int a, expr const & b) { return pw(b.ctx().num_val(a, b.get_sort()), b); }

inline expr mod(expr const& a, expr const& b) { _Z3_MK_BIN_(a, b, Z3_mk_mod); }
inline expr mod(expr const& a, expr const& b) {
if (a.is_bv()) {
_Z3_MK_BIN_(a, b, Z3_mk_bvsmod);
}
else {
_Z3_MK_BIN_(a, b, Z3_mk_mod);
}
}
inline expr mod(expr const & a, int b) { return mod(a, a.ctx().num_val(b, a.get_sort())); }
inline expr mod(int a, expr const & b) { return mod(b.ctx().num_val(a, b.get_sort()), b); }

inline expr operator%(expr const& a, expr const& b) { return mod(a, b); }
inline expr operator%(expr const& a, int b) { return mod(a, b); }
inline expr operator%(int a, expr const& b) { return mod(a, b); }


inline expr rem(expr const& a, expr const& b) {
if (a.is_fpa() && b.is_fpa()) {
_Z3_MK_BIN_(a, b, Z3_mk_fpa_rem);
Expand Down

0 comments on commit 3074e2b

Please sign in to comment.