Math: Fix handling of negative integers in @calc.

This commit is contained in:
Valentin Lorentz 2013-12-15 18:29:34 +00:00
parent 01278dc56c
commit 3cc52aefca

View File

@ -201,8 +201,8 @@ class Math(callbacks.Plugin):
else: else:
i = float(s) i = float(s)
x = complex(i) x = complex(i)
if x == abs(x): if x.imag == 0:
x = abs(x) x = x.real
# Need to use string-formatting here instead of str() because # Need to use string-formatting here instead of str() because
# use of str() on large numbers loses information: # use of str() on large numbers loses information:
# str(float(33333333333333)) => '3.33333333333e+13' # str(float(33333333333333)) => '3.33333333333e+13'