From 5eac427f156c94e8a7cfa7fe7071f9299b5be4b4 Mon Sep 17 00:00:00 2001 From: Keith Jones Date: Tue, 10 Feb 2004 03:21:45 +0000 Subject: [PATCH] Changed float division to integer division --- plugins/Math.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/Math.py b/plugins/Math.py index 96a9f2a3f..a89b96fd3 100644 --- a/plugins/Math.py +++ b/plugins/Math.py @@ -104,7 +104,7 @@ class Math(callbacks.Privmsg): else: digit = str(digit) valStr = digit + valStr - number = int(math.floor(number / base)) + number = number // base if negative: return '-%s' % valStr else: @@ -116,6 +116,8 @@ class Math(callbacks.Privmsg): base, 2 through 36. Returns a string. """ number = long(str(number), fromBase) + if toBase == 10: + return str(number) return self._convertDecimalToBase(number, toBase) _mathEnv = {'__builtins__': types.ModuleType('__builtins__'), 'i': 1j}