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