From 212ea12e3addf10091bd7b6c85f4e11349363f92 Mon Sep 17 00:00:00 2001 From: ayumin Date: Fri, 23 May 2014 15:32:19 +0000 Subject: [PATCH] add information of incompatibility about Prime.prime? [Bug #7395] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ NEWS | 5 +++++ lib/prime.rb | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f6a9c0715e..6e9d2ef6ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat May 24 00:25:34 2014 Ayumu AIZAWA + + * NEWS: add information of incompatibility about Prime.prime? + * lib/prime.rb: fix docs. + Fri May 23 21:36:28 2014 Josh Goebel * net/protocol.rb (using_each_crlf_line): fix SMTP dot-stuffing diff --git a/NEWS b/NEWS index 8bc0625f8a..d6a97dabda 100644 --- a/NEWS +++ b/NEWS @@ -111,6 +111,11 @@ with all sufficient information, see the ChangeLog file. * Removed because it conflicts to minitest 5, and it was just an wrapper of minitest 4. [Feature #9711] +* Prime + * incompatible changes: + * Prime.prime? now returns false for negative numbers. This method + should not be used to know the number is composite or not. [Bug #7395] + === Built-in global variables compatibility issues === C API updates diff --git a/lib/prime.rb b/lib/prime.rb index 6d3936e317..4b14a221f7 100644 --- a/lib/prime.rb +++ b/lib/prime.rb @@ -29,7 +29,7 @@ class Integer Prime.prime_division(self, generator) end - # Returns true if +self+ is a prime number, false for a composite. + # Returns true if +self+ is a prime number, else returns false. def prime? Prime.prime?(self) end @@ -150,7 +150,7 @@ class Prime end - # Returns true if +value+ is prime, false for a composite. + # Returns true if +value+ is prime number, else returns false. # # == Parameters #