3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-14 04:48:45 +00:00

accepting floats

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2016-10-02 10:08:23 -07:00
parent 279621c1d7
commit 57ebf7bd38

View file

@ -6712,6 +6712,8 @@ class Optimize(Z3PPObject):
"""
if _is_int(weight):
weight = "%d" % weight
elif isinstance(weight, (float, double)):
weight = "%f" % weight
if not isinstance(weight, str):
raise Z3Exception("weight should be a string or an integer")
if id is None: