Ruby 2.4参考手册
Prime
Prime::TrialDivisionGenerator
Parent:Prime::PseudoPrimeGenerator
An implementation of PseudoPrimeGenerator
which uses a prime table generated by trial division.
Public Class Methods
new() Show source
Calls superclass method Prime::PseudoPrimeGenerator.new
# File lib/prime.rb, line 327
def initialize
@index = -1
super
end
Public Instance Methods
next()
Alias for: succ
rewind() Show source
# File lib/prime.rb, line 335
def rewind
initialize
end
succ() Show source
# File lib/prime.rb, line 332
def succ
TrialDivision.instance[@index += 1]
end
Also aliased as: next
Ruby Core © 1993–2017 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.
Prime相关
Ruby 是一种面向对象、命令式、函数式、动态的通用编程语言,是世界上最优美而巧妙的语言。
主页 | https://www.ruby-lang.org/ |
源码 | https://github.com/ruby/ruby |
版本 | 2.4 |
发布版本 | 2.4.1 |