4件ヒット
[1-4件を表示]
(0.178秒)
ライブラリ
- prime (4)
キーワード
- each (1)
-
each
_ with _ index (1) -
upper
_ bound (1) -
with
_ index (1)
検索結果
先頭4件
-
Prime
:: PseudoPrimeGenerator # upper _ bound -> Integer | nil (27607.0) -
現在の列挙上界を返します。 nil は上界がなく無限に素数を列挙すべきであることを意味します。
現在の列挙上界を返します。 nil は上界がなく無限に素数を列挙すべきであることを意味します。 -
Prime
:: PseudoPrimeGenerator # each _ with _ index {|prime , index| . . . } -> self (18625.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 # with _ index {|prime , index| . . . } -> self (18625.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 # each -> self (18307.0) -
素数を与えられたブロックに渡して評価します。
素数を与えられたブロックに渡して評価します。