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.
This commit is contained in:
Sei Lisa 2016-05-21 03:10:31 +02:00
parent 13663ff077
commit e40c52075b

View file

@ -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