Denormalize relative speed correctly if target has it equal to 0

This commit is contained in:
DarkPhoenix
2019-07-26 00:29:11 +03:00
parent 473b65850d
commit 530dd1c03b
2 changed files with 7 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ keepDigits = int(sys.float_info.dig / 2)
def floatUnerr(value):
"""Round possible float number error, killing some precision in process."""
if value == 0:
if value in (0, math.inf):
return value
# Find round factor, taking into consideration that we want to keep at least
# predefined amount of significant digits