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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user