]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/math.rb
quiz: stop quizzes and timers on cleanup
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / math.rb
index dde4e954688d384fff712342bf4b1627c7a39042..081c9c042378cf761c5670e5df82dc34df3f6238 100644 (file)
@@ -44,7 +44,7 @@ class MathPlugin < Plugin
       val = Math.exp($2).to_s
       expr.gsub!(/#{Regexp.escape exp}/, "+#{val}")
     end
-    
+
     while expr =~ /^\s*(dec2hex\s*(\d+))\s*\?*/
       exp = $1
       val = sprintf("%x", $2)
@@ -56,13 +56,13 @@ class MathPlugin < Plugin
     while expr =~ /(log\s*((\d+\.?\d*)|\d*\.?\d+))\s*/
       exp = $1
       res = $2
-      
+
       if res == 0
         val = "Infinity"
       else
         val = Math.log(res).to_s
       end
-      
+
       expr.gsub!(/#{Regexp.escape exp}/, "+#{val}")
     end
 
@@ -110,7 +110,7 @@ class MathPlugin < Plugin
              answer = "a number with >30 digits..."
            end
          end
-         m.reply answer
+         m.reply answer.to_s
        rescue Exception => e
          error e
          m.reply "illegal expression \"#{m.params}\""