mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Changed float division to integer division
This commit is contained in:
parent
03ebdc3512
commit
5eac427f15
@ -104,7 +104,7 @@ class Math(callbacks.Privmsg):
|
|||||||
else:
|
else:
|
||||||
digit = str(digit)
|
digit = str(digit)
|
||||||
valStr = digit + valStr
|
valStr = digit + valStr
|
||||||
number = int(math.floor(number / base))
|
number = number // base
|
||||||
if negative:
|
if negative:
|
||||||
return '-%s' % valStr
|
return '-%s' % valStr
|
||||||
else:
|
else:
|
||||||
@ -116,6 +116,8 @@ class Math(callbacks.Privmsg):
|
|||||||
base, 2 through 36. Returns a string.
|
base, 2 through 36. Returns a string.
|
||||||
"""
|
"""
|
||||||
number = long(str(number), fromBase)
|
number = long(str(number), fromBase)
|
||||||
|
if toBase == 10:
|
||||||
|
return str(number)
|
||||||
return self._convertDecimalToBase(number, toBase)
|
return self._convertDecimalToBase(number, toBase)
|
||||||
|
|
||||||
_mathEnv = {'__builtins__': types.ModuleType('__builtins__'), 'i': 1j}
|
_mathEnv = {'__builtins__': types.ModuleType('__builtins__'), 'i': 1j}
|
||||||
|
Loading…
Reference in New Issue
Block a user