5件ヒット
[1-5件を表示]
(0.086秒)
種類
- インスタンスメソッド (4)
- 特異メソッド (1)
ライブラリ
- prime (5)
キーワード
- each (1)
-
each
_ with _ index (1) - new (1)
-
upper
_ bound (1) -
with
_ index (1)
検索結果
先頭5件
- Prime
:: PseudoPrimeGenerator # each -> self - Prime
:: PseudoPrimeGenerator # each _ with _ index {|prime , index| . . . } -> self - Prime
:: PseudoPrimeGenerator # upper _ bound -> Integer | nil - Prime
:: PseudoPrimeGenerator # with _ index {|prime , index| . . . } -> self - Prime
:: PseudoPrimeGenerator . new(upper _ bound = nil) -> Prime :: PseudoPrimeGenerator
-
Prime
:: PseudoPrimeGenerator # each -> self (304.0) -
素数を与えられたブロックに渡して評価します。
素数を与えられたブロックに渡して評価します。 -
Prime
:: PseudoPrimeGenerator # each _ with _ index {|prime , index| . . . } -> self (304.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
@return ブロックを与えられた場合は self を返します。 ブロックを与えられなかった場合は Enumerator を返します。
//emlist[例][ruby]{
require 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end
# [2, 0]
# [3, 1]
# [5, 2]
# [7, 3]
//}
@see Enumerator#with_ind... -
Prime
:: PseudoPrimeGenerator # upper _ bound -> Integer | nil (304.0) -
現在の列挙上界を返します。 nil は上界がなく無限に素数を列挙すべきであることを意味します。
現在の列挙上界を返します。 nil は上界がなく無限に素数を列挙すべきであることを意味します。 -
Prime
:: PseudoPrimeGenerator # with _ index {|prime , index| . . . } -> self (304.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
@return ブロックを与えられた場合は self を返します。 ブロックを与えられなかった場合は Enumerator を返します。
//emlist[例][ruby]{
require 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end
# [2, 0]
# [3, 1]
# [5, 2]
# [7, 3]
//}
@see Enumerator#with_ind... -
Prime
:: PseudoPrimeGenerator . new(upper _ bound = nil) -> Prime :: PseudoPrimeGenerator (304.0) -
自身を初期化します。
自身を初期化します。
@param upper_bound 列挙する素数の上界を指定します。