[ruby-core:62465] [ruby-trunk - Bug #7395] [Closed] Negative numbers can't be primes by definition

From: ayumu.aizawa@...
Date: 2014-05-08 18:22:39 UTC
List: ruby-core #62465
Issue #7395 has been updated by Ayumu AIZAWA.

Status changed from Assigned to Closed
% Done changed from 0 to 100

Applied in changeset r45878.

----------
* lib/prime.rb (Prime#prime?): negative numbers can't be primes
  by definition. reported by Ivan Kataitsev. [Bug #7395]
* test/test_prime.rb: add test.

----------------------------------------
Bug #7395: Negative numbers can't be primes by definition
https://bugs.ruby-lang.org/issues/7395#change-46622

* Author: Zachary Scott
* Status: Closed
* Priority: Normal
* Assignee: Yuki Sonoda
* Category: lib
* Target version: current: 2.2.0
* ruby -v: 2.0.0
* Backport: 
----------------------------------------
from github:
https://github.com/ruby/ruby/pull/187

By definition, a prime number can be a positive integer greater than 1.

http://mathworld.wolfram.com/PrimeNumber.html

---Files--------------------------------
prime_refute_negative_numbers.patch (1.16 KB)


-- 
https://bugs.ruby-lang.org/

In This Thread