るりまサーチ (Ruby 2.7.0)

最速Rubyリファレンスマニュアル検索!
4件ヒット [1-4件を表示] (0.020秒)

別のキーワード

  1. integer pred
  2. _builtin pred
  3. pred integer
  4. pred _builtin

クラス

キーワード

検索結果

Integer#pred -> Integer (54346.0)

self から -1 した値を返します。

self から -1 した値を返します。

//emlist[][ruby]{
1.pred #=> 0
(-1).pred #=> -2
//}

@see Integer#next

Integer#next -> Integer (25.0)

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

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

//emlist[][ruby]{
1.next #=> 2
(-1).next #=> 0
1.succ #=> 2
(-1).succ #=> 0
//}

@see Integer#pred

Integer#succ -> Integer (25.0)

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

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

//emlist[][ruby]{
1.next #=> 2
(-1).next #=> 0
1.succ #=> 2
(-1).succ #=> 0
//}

@see Integer#pred

Numeric (25.0)

数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。

数値を表す抽象クラスです。Integer や Float などの数値クラス
は Numeric のサブクラスとして実装されています。

演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッドは、サブクラスで提供されているメソッド
(+, -, *, /, %) を利用して定義されるものがほとんどです。
つまり Numeric で定義されているメソッドは、Numeric のサブクラスとして新たに数値クラスを定義した時に、
演算メソッド(+, -, *, /, %, <=>, coerce)だけを定義すれ...