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.7.6/lib/prime.rb, line 331
def initialize
@index = -1
super
end
No documentation available
Instance Methods
#
lib/prime.rb
View on GitHub
# File tmp/rubies/ruby-2.7.6/lib/prime.rb, line 339
def rewind
initialize
end
No documentation available
#
lib/prime.rb
View on GitHub
# File tmp/rubies/ruby-2.7.6/lib/prime.rb, line 336
def succ
TrialDivision.instance[@index += 1]
end
No documentation available