An implementation of PseudoPrimeGenerator
which uses a prime table generated by trial division.
Class Methods
::
lib/prime.rb
View on GitHub
# File tmp/rubies/ruby-2.5.9/lib/prime.rb, line 328
def initialize
@index = -1
super
end
No documentation available
Instance Methods
#
lib/prime.rb
View on GitHub
# File tmp/rubies/ruby-2.5.9/lib/prime.rb, line 336
def rewind
initialize
end
No documentation available
#
lib/prime.rb
View on GitHub
# File tmp/rubies/ruby-2.5.9/lib/prime.rb, line 333
def succ
TrialDivision.instance[@index += 1]
end
No documentation available