From 57ebf7bd386a931cf494ed2039d0d30518df78a3 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sun, 2 Oct 2016 10:08:23 -0700 Subject: [PATCH] accepting floats Signed-off-by: Nikolaj Bjorner --- src/api/python/z3/z3.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/api/python/z3/z3.py b/src/api/python/z3/z3.py index 4ee5883ed..7e58a724c 100644 --- a/src/api/python/z3/z3.py +++ b/src/api/python/z3/z3.py @@ -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: