primes-utils 2.5.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af94be1cfe58cb1704376223da97cdb48d6cc8a0
4
- data.tar.gz: 924587a02967cd156d2115d5d1ac22d547ca9089
3
+ metadata.gz: 7bc5495497089b070f595b0456a1b0c00da065d8
4
+ data.tar.gz: fd32d881956306de64948f69171909bb4f65843c
5
5
  SHA512:
6
- metadata.gz: 1b30b2ac81ef9e21321a667d3e5f009218300048367a6be81c083f3293c32b131bd1461020ec349674d7449f0bef453431aaa96b334a526c0cb065dc9c2c5ba0
7
- data.tar.gz: 78bdfd7fcc6d0b9904a42b13b4cf5be82c45da2a21317e47c05efefc44928b411a6612a6b044b4ff9536a29500d49a099714c4155f1e8a4c98ab01c17c2b341e
6
+ metadata.gz: 12b152e50667e3646c92104e22f61cfb5e2f028d452a1fc6dc9c6eeb638dbdbe044aaab23086aa17cedd18d27188063a4293efcff1520be7ec363272c1bb06b4
7
+ data.tar.gz: faa16320abef1a7f78e3c5c4fa4e76a90b784ee8a3b66c9597e89dd8bab5d15dbbd1bb588f3ba88205688cd7007202a7167fd57001b0ec7c6f47debc23df4e0e
data/README.md CHANGED
@@ -193,17 +193,18 @@ All the `primes-utils` methods are `instance_methods` for `class Integer`.
193
193
 
194
194
  ## History
195
195
  ```
196
- 2.5.0 9 more index primes under the 110-millionth in nths; fixed Ruby 1.8 incompatibility in primes;
197
- better|simpler technique for select_pg, significant speed increases for large ranges; used now
198
- in all sozcore2 client methods primes, primescnt and primenth|nthprime; more code cleanups
196
+ 2.5.1corrected minor error in select_pg
197
+ 2.5.0 9 more index primes under the 110-millionth in nths; fixed Ruby 1.8 incompatibility in primes;
198
+ better|simpler technique for select_pg, significant speed increases for large ranges; used now
199
+ in all sozcore2 client methods primes, primescnt and primenth|nthprime; more code cleanups
199
200
  2.4.0 – fixed error in algorithm when ks resgroup ≤ sqrt(end_num) resgroup; algorithm now split
200
201
  arrays when start_num > sqrt(end_num) in sozcore2, whose code also signficantly optimized,
201
202
  with API change adding pcs2start value to output parameters to use in primenth, which changed
202
203
  to use it; ruby idiom code opt for set_start_value; consolidated pcs_to_num | pcs_to_start_num
203
204
  functions into one new pcs_to_num, with associated changes in sozcore1|2; primes|cnt also
204
205
  significantly faster resulting from sozcore2 changes; massive code cleanups all-arround; added
205
- private methods select_pg (to adaptively select the pg used in primes), and array_check (used in
206
- sozcore2 to catch array creation out-of-memory errors)
206
+ private methods select_pg (to adaptively select the pg used in primes), and array_check (used in
207
+ sozcore2 to catch array creation out-of-memory errors)
207
208
  2.3.0 – primescnt now finds primes upto some integer much faster, and for much larger integers
208
209
  increased index nth primes to over 2 billionth; used in nthprime|primenth and primescnt
209
210
  2.2.0 – for sozcore2: refactored to include more common code; changed output api; added memory
@@ -215,10 +215,10 @@ module Primes
215
215
  (d >>= 1; s += 1) while d.even?
216
216
  k.times do
217
217
  a = 2 + rand(n-4)
218
- x = a.to_bn.mod_exp(d,n) # x = (a**d) mod n
218
+ x = a.to_bn.mod_exp(d,n) # x = (a**d) mod n
219
219
  next if x == 1 or x == n-1
220
220
  (s-1).times do
221
- x = x.mod_exp(2,n) # x = (x**2) mod n
221
+ x = x.mod_exp(2,n) # x = (x**2) mod n
222
222
  return false if x == 1
223
223
  break if x == n-1
224
224
  end
@@ -256,7 +256,7 @@ module Primes
256
256
 
257
257
  def primes_utils # display list of available methods
258
258
  methods = %w/prime? primemr? primes primesf primesmr primescnt
259
- primescntf primescntmr primenth|nthprime factors|prime_division/
259
+ primescntf primescntmr primenth|nthprime factors|prime_division primes_utils/
260
260
  (methods - (@@os_has_factor ? [] : %w/primesf primescntf/)).join(" ")
261
261
  end
262
262
 
@@ -448,7 +448,6 @@ module Primes
448
448
  primes = [2, 3, 5] # use P5 for small ranges
449
449
  primes << 7 if range_size > 35*10**5 # use P7 for midsize ranges
450
450
  primes << 11 if range_size > 850*10**5 # use P11 for large ranges
451
- primes << 13 if range_size > 550*10**7 # use P13 for larger ranges
452
451
  [primes, primes.reduce(:*)] # [excluded primes, mod] for PG
453
452
  end
454
453
 
@@ -1,5 +1,5 @@
1
1
  module Primes
2
2
  module Utils
3
- VERSION = "2.5.0"
3
+ VERSION = "2.5.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: primes-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jabari Zakiya
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-02 00:00:00.000000000 Z
11
+ date: 2015-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler