mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Math: Fix handling of negative integers in @calc.
This commit is contained in:
parent
01278dc56c
commit
3cc52aefca
@ -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'
|
||||||
|
Loading…
Reference in New Issue
Block a user