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:
i = float(s)
x = complex(i)
if x == abs(x):
x = abs(x)
if x.imag == 0:
x = x.real
# Need to use string-formatting here instead of str() because
# use of str() on large numbers loses information:
# str(float(33333333333333)) => '3.33333333333e+13'