mirror of
https://github.com/Z3Prover/z3
synced 2026-05-30 21:57:46 +00:00
Modify behavior for division by zero
Allow division by zero in z3 expressions without raising an error.
This commit is contained in:
parent
b27a8a0d5f
commit
21cb8b3b01
1 changed files with 1 additions and 1 deletions
|
|
@ -3375,7 +3375,7 @@ def RatVal(a, b, ctx=None):
|
||||||
_z3_assert(_is_int(a) or isinstance(a, str), "First argument cannot be converted into an integer")
|
_z3_assert(_is_int(a) or isinstance(a, str), "First argument cannot be converted into an integer")
|
||||||
_z3_assert(_is_int(b) or isinstance(b, str), "Second argument cannot be converted into an integer")
|
_z3_assert(_is_int(b) or isinstance(b, str), "Second argument cannot be converted into an integer")
|
||||||
if b == 0:
|
if b == 0:
|
||||||
raise ValueError("Denominator cannot be zero")
|
pass # division by 0 is legal in z3 expressions.
|
||||||
return simplify(RealVal(a, ctx) / RealVal(b, ctx))
|
return simplify(RealVal(a, ctx) / RealVal(b, ctx))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue