summaryrefslogtreecommitdiffstats
path: root/lib/mathn.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-19 15:08:14 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-19 15:08:14 +0000
commitfaf34ad5b1b8cbe7e68cf6bfe091fae80e0c4438 (patch)
treee2485887b59eff5ca45564e0922653d8f7f6a83f /lib/mathn.rb
parentfcd6902afc4b0b8e03c42a08ade785f2c0cb1b5b (diff)
downloadruby-faf34ad5b1b8cbe7e68cf6bfe091fae80e0c4438.tar.gz
ruby-faf34ad5b1b8cbe7e68cf6bfe091fae80e0c4438.tar.xz
ruby-faf34ad5b1b8cbe7e68cf6bfe091fae80e0c4438.zip
* lib/mathn.rb (Integer::prime_division): raise ZeroDivisionError
on zeros. [ruby-dev:28739] * version.h: 1.8.5 - prepare for preview1. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mathn.rb')
-rw-r--r--lib/mathn.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/mathn.rb b/lib/mathn.rb
index 14e2e9272..a5a121c6c 100644
--- a/lib/mathn.rb
+++ b/lib/mathn.rb
@@ -43,6 +43,7 @@ class Integer
end
def prime_division
+ raise ZeroDivisionError if self == 0
ps = Prime.new
value = self
pv = []