るりまサーチ (Ruby 2.7.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.023秒)
トップページ > バージョン:2.7.0[x] > クエリ:Integer[x] > クラス:Range[x]

別のキーワード

  1. openssl integer
  2. asn1 integer
  3. _builtin integer
  4. integer chr
  5. integer new

ライブラリ

キーワード

検索結果

Range#hash -> Integer (307.0)

始端と終端のハッシュ値と Range#exclude_end? の値からハッシュ値を計算して整数として返します。

...始端と終端のハッシュ値と Range#exclude_end? の値からハッシュ値を計算して整数として返します。

//emlist[例][ruby]{
p (1..2).hash # => 5646
p (1...2).hash # => 16782863
//}...

Range#size -> Integer | Float::INFINITY | nil (307.0)

範囲内の要素数を返します。始端、終端のいずれかのオブジェクトが Numeric のサブクラスのオブジェクトではない場合には nil を返します。

範囲内の要素数を返します。始端、終端のいずれかのオブジェクトが
Numeric のサブクラスのオブジェクトではない場合には nil を返します。

//emlist[例][ruby]{
(10..20).size # => 11
("a".."z").size # => nil
(-Float::INFINITY..Float::INFINITY).size # => Infinity
//}