154件ヒット
[1-100件を表示]
(0.119秒)
種類
- インスタンスメソッド (143)
- 特異メソッド (11)
ライブラリ
- prime (154)
キーワード
- each (22)
-
each
_ with _ index (22) - new (11)
- next (11)
- rewind (11)
- succ (11)
-
upper
_ bound (11) -
upper
_ bound= (11) -
with
_ index (22) -
with
_ object (22)
検索結果
先頭5件
-
Prime
:: PseudoPrimeGenerator # each _ with _ index -> Enumerator (12101.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...を返します。 ブロックを与えられなかった場合は 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_index... -
Prime
:: PseudoPrimeGenerator # each _ with _ index {|prime , index| . . . } -> self (12101.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...を返します。 ブロックを与えられなかった場合は 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_index... -
Prime
:: PseudoPrimeGenerator # rewind -> () (12101.0) -
列挙状態を巻き戻します。
...列挙状態を巻き戻します。
サブクラスで実装してください。
@raise NotImplementedError 必ず発生します。
@see Enumerator#rewind... -
Prime
:: PseudoPrimeGenerator # with _ index -> Enumerator (12101.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...を返します。 ブロックを与えられなかった場合は 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_index... -
Prime
:: PseudoPrimeGenerator # with _ index {|prime , index| . . . } -> self (12101.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...を返します。 ブロックを与えられなかった場合は 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_index... -
Prime
:: PseudoPrimeGenerator # with _ object(obj) -> Enumerator (12101.0) -
与えられた任意のオブジェクトと要素をブロックに渡して評価します。
...bj 任意のオブジェクトを指定します。
@return 最初に与えられたオブジェクトを返します。
@return ブロックを与えられた場合は obj を返します。ブロックを与えられなかった場合は Enumerator を返します。
@see Enumerator#with_object... -
Prime
:: PseudoPrimeGenerator # with _ object(obj) {|prime , obj| . . . } -> object (12101.0) -
与えられた任意のオブジェクトと要素をブロックに渡して評価します。
...bj 任意のオブジェクトを指定します。
@return 最初に与えられたオブジェクトを返します。
@return ブロックを与えられた場合は obj を返します。ブロックを与えられなかった場合は Enumerator を返します。
@see Enumerator#with_object... -
Prime
:: PseudoPrimeGenerator . new(upper _ bound = nil) -> Prime :: PseudoPrimeGenerator (9201.0) -
自身を初期化します。
自身を初期化します。
@param upper_bound 列挙する素数の上界を指定します。 -
Prime
:: PseudoPrimeGenerator # each {|prime| . . . } -> object (9101.0) -
素数を与えられたブロックに渡して評価します。
素数を与えられたブロックに渡して評価します。 -
Prime
:: PseudoPrimeGenerator # upper _ bound -> Integer | nil (9101.0) -
現在の列挙上界を返します。 nil は上界がなく無限に素数を列挙すべきであることを意味します。
...現在の列挙上界を返します。 nil は上界がなく無限に素数を列挙すべきであることを意味します。...