Ruby 1.9.0 リファレンスマニュアル > ライブラリ一覧 > library mathn > class Prime > next
succ
next
次の素数を返します。
例:
q = Prime.new q.succ # => 2 q.succ # => 3 q.succ # => 5