3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-22 16:27:37 +00:00

Modify behavior for division by zero

Allow division by zero in z3 expressions without raising an error.
This commit is contained in:
Nikolaj Bjorner 2026-02-12 07:10:00 -08:00
parent bcc87975e5
commit 487db1a658

View file

@ -3381,7 +3381,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(b) or isinstance(b, str), "Second argument cannot be converted into an integer")
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))