summaryrefslogtreecommitdiff
path: root/irc/rbot/files/patch-math
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2004-03-27 16:04:40 +0000
committerPav Lucistnik <pav@FreeBSD.org>2004-03-27 16:04:40 +0000
commite96f1d48d68a59d6b4e6009229d3cbd9ab54aa81 (patch)
treeed70a969709e40f9ea3788a0f5f87e97ce7ca544 /irc/rbot/files/patch-math
parentCorrect plist entry. (diff)
- Runtime fixes for ruby-1.8
- Raise PORTREVISION PR: ports/64782, ports/64789 Submitted by: David Bushong <david+ports@bushong.net> (maintainer)
Diffstat (limited to 'irc/rbot/files/patch-math')
-rw-r--r--irc/rbot/files/patch-math28
1 files changed, 28 insertions, 0 deletions
diff --git a/irc/rbot/files/patch-math b/irc/rbot/files/patch-math
new file mode 100644
index 000000000000..87dd66063e2c
--- /dev/null
+++ b/irc/rbot/files/patch-math
@@ -0,0 +1,28 @@
+--- rbot/plugins/math.rb.orig Thu Mar 25 17:33:36 2004
++++ rbot/plugins/math.rb Mon Jan 27 11:52:37 2003
+@@ -77,13 +77,13 @@
+ expr.gsub!(/\bover /, "/ ")
+ expr.gsub!(/\bsquared/, "**2 ")
+ expr.gsub!(/\bcubed/, "**3 ")
+- expr.gsub!(/\bto\s+(\d+)(r?st|nd|rd|th)?( power)?/, "**#$1 ")
++ expr.gsub!(/\bto\s+(\d+)(r?st|nd|rd|th)?( power)?/, '**\1 ')
+ expr.gsub!(/\bpercent of/, "*0.01*")
+ expr.gsub!(/\bpercent/, "*0.01")
+ expr.gsub!(/\% of\b/, "*0.01*")
+ expr.gsub!(/\%/, "*0.01")
+- expr.gsub!(/\bsquare root of (\d+)/, "#$1 ** 0.5 ")
+- expr.gsub!(/\bcubed? root of (\d+)/, "#$1 **(1.0/3.0) ")
++ expr.gsub!(/\bsquare root of (\d+)/, '\1 ** 0.5 ')
++ expr.gsub!(/\bcubed? root of (\d+)/, '\1 **(1.0/3.0) ')
+ expr.gsub!(/ of /, " * ")
+ expr.gsub!(/(bit(-| )?)?xor(\'?e?d( with))?/, "^")
+ expr.gsub!(/(bit(-| )?)?or(\'?e?d( with))?/, "|")
+@@ -101,7 +101,7 @@
+ if answer =~ /^[-+\de\.]+$/
+ answer = sprintf("%1.12f", answer)
+ answer.gsub!(/\.?0+$/, "")
+- answer.gsub!(/(\.\d+)000\d+/, $1)
++ answer.gsub!(/(\.\d+)000\d+/, '\1')
+ if (answer.length > 30)
+ answer = "a number with >30 digits..."
+ end