From: nagachaitanya.vellanki@... Date: 2015-12-10T16:24:15+00:00 Subject: [ruby-core:72036] [Ruby trunk - Feature #11578] Add a method to check if a number is probably prime or composite (Patch included) Issue #11578 has been updated by NagaChaitanya Vellanki. Yui NARUSE wrote: > Use OpenSSL::BN. Rehearsal --------------------------------------------------------------- Probably prime 11.990000 0.060000 12.050000 ( 12.054223) OpenSSL::BN.prime_fasttest? 0.020000 0.000000 0.020000 ( 0.024519) ----------------------------------------------------- total: 12.070000sec user system total real Probably prime 12.090000 0.050000 12.140000 ( 12.147566) OpenSSL::BN.prime_fasttest? 0.020000 0.000000 0.020000 ( 0.021217) Thanks for closing. ---------------------------------------- Feature #11578: Add a method to check if a number is probably prime or composite (Patch included) https://bugs.ruby-lang.org/issues/11578#change-55447 * Author: NagaChaitanya Vellanki * Status: Rejected * Priority: Normal * Assignee: Yukihiro Matsumoto ---------------------------------------- Added a method to check if a given n is probably prime or composite using Miller- Rabin Test. This method is faster that the sieve method to check for an arbitrary n. Please review my pull request. https://github.com/ruby/ruby/pull/1051 ---Files-------------------------------- 0001-Add-Prime.probably_prime.patch (4.46 KB) -- https://bugs.ruby-lang.org/