From e40c52075bb7e6c43f90bf4a0b82752b83c7e7a2 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Sat, 21 May 2016 03:10:31 +0200 Subject: [PATCH] Make ForceFloat more robust on non-float input. It was designed so that only ints and floats should be accepted. But for safety, and for reuse, make that "any non-float" so that long integers are also truncated to F32. --- lslopt/lslbasefuncs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lslopt/lslbasefuncs.py b/lslopt/lslbasefuncs.py index 7fddcef..650ce70 100644 --- a/lslopt/lslbasefuncs.py +++ b/lslopt/lslbasefuncs.py @@ -258,7 +258,7 @@ def zstr(s): def ff(x): """Force x to be a float""" - if type(x) == int: + if type(x) != float: x = F32(float(x)) return x