Ruby 3.1.0 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Integerクラス > next

instance method Integer#next

next -> Integer[permalink][rdoc]
succ -> Integer

self の次の整数を返します。


1.next      #=> 2
(-1).next   #=> 0
1.succ      #=> 2
(-1).succ   #=> 0

[SEE_ALSO] Integer#pred