Ruby 1.9.3 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Bignumクラス > <=>

instance method Bignum#<=>

self <=> other -> Fixnum | nil

self と other を比較して、self が大きい時に正、 等しい時に 0、小さい時に負の整数を返します。

[PARAM] other:
比較対象の数値
[RETURN]
-1 か 0 か 1 のいずれか
1 <=> 2 #=> -1
1 <=> 1 #=> 0
2 <=> 1 #=> 1
class Bignum