るりまサーチ

最速Rubyリファレンスマニュアル検索!
590件ヒット [1-100件を表示] (0.182秒)
トップページ > クエリ:-[x] > クエリ:I[x] > クエリ:>[x] > クエリ:INTEGER[x] > クエリ:==[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. _builtin i

ライブラリ

クラス

モジュール

検索結果

<< 1 2 3 ... > >>

Integer#==(other) -> bool (30312.0)

比較演算子。数値として等しいか判定します。

...比較演算子。数値として等しいか判定します。

@param other 比較対象の数値
@return self と other が等しい場合 true を返します。
そうでなければ false を返します。

//emlist[][ruby]{
1 == 2 # => false
1 == 1.0 # => true
//}...

Integer#===(other) -> bool (21412.0)

比較演算子。数値として等しいか判定します。

...比較演算子。数値として等しいか判定します。

@param other 比較対象の数値
@return self と other が等しい場合 true を返します。
そうでなければ false を返します。

//emlist[][ruby]{
1 == 2 # => false
1 == 1.0 # => true
//}...

Integer#allbits?(mask) -> bool (15318.0)

self & mask の全てのビットが 1 なら true を返します。

...k == mask と等価です。

@param mask ビットマスクを整数で指定します。

//emlist[][ruby]{
42.allbits?(42) # => true
0b1010_1010.allbits?(0b1000_0010) # => true
0b1010_1010.allbits?(0b1000_0001) # => false
0b1000_0010.allbits?(0b1010_1010) # => false
//}

@see In...
...teger#anybits?
@see Integer#nobits?...

Integer#nobits?(mask) -> bool (15318.0)

self & mask のすべてのビットが 0 なら true を返します。

...k == 0 と等価です。

@param mask ビットマスクを整数で指定します。

//emlist[][ruby]{
42.nobits?(42) # => false
0b1010_1010.nobits?(0b1000_0010) # => false
0b1010_1010.nobits?(0b1000_0001) # => false
0b0100_0101.nobits?(0b1010_1010) # => true
//}

@see Integer#...
...allbits?
@see Integer#anybits?...

Enumerable#find_index {|obj| ... } -> Integer | nil (12668.0)

条件に一致する最初の要素の位置を返します。

...指定します。

指定された val と == で等しい最初の要素の位置を返します。
等しい要素がひとつもなかった場合は nil を返します。

//emlist[例][ruby]{
(1..10).find_index(11) #=> nil
(1..10).find_index(2) #=> 1
//}

ブロックが与えられた場...
...置を返します。
一つも真にならなかった場合は nil を返します。

//emlist[例][ruby]{
(1..10).find_index {|i| i % 5 == 0 and i % 7 == 0 } #=> nil
(1..100).find_index {|i| i % 5 == 0 and i % 7 == 0 } #=> 34
//}

引数、ブロックのどちらも与えられなかった...

絞り込み条件を変える

Enumerable#find_index(val) -> Integer | nil (12668.0)

条件に一致する最初の要素の位置を返します。

...指定します。

指定された val と == で等しい最初の要素の位置を返します。
等しい要素がひとつもなかった場合は nil を返します。

//emlist[例][ruby]{
(1..10).find_index(11) #=> nil
(1..10).find_index(2) #=> 1
//}

ブロックが与えられた場...
...置を返します。
一つも真にならなかった場合は nil を返します。

//emlist[例][ruby]{
(1..10).find_index {|i| i % 5 == 0 and i % 7 == 0 } #=> nil
(1..100).find_index {|i| i % 5 == 0 and i % 7 == 0 } #=> 34
//}

引数、ブロックのどちらも与えられなかった...

Array#find_index {|item| ...} -> Integer | nil (12616.0)

条件に一致する最初の要素の位置を返します。

...定された val と == で等しい最初の要素の位置を返します。
等しい要素がひとつもなかった場合は nil を返します。

//emlist[例][ruby]{
p [1, 0, 0, 1, 0].index(1) #=> 0
p [1, 0, 0, 0, 0].index(1) #=> 0
p [0, 0, 0, 0, 0].index(1) #=> nil
//}

ブロック...
...返します。
一つも真にならなかった場合は nil を返します。

//emlist[例][ruby]{
p [0, 1, 0, 1, 0].index {|v| v > 0} #=> 1
//}


引数、ブロックのどちらも与えられなかった場合は、
Enumerator のインスタンスを返します。

@see Array#rindex...

Array#find_index(val) -> Integer | nil (12616.0)

条件に一致する最初の要素の位置を返します。

...定された val と == で等しい最初の要素の位置を返します。
等しい要素がひとつもなかった場合は nil を返します。

//emlist[例][ruby]{
p [1, 0, 0, 1, 0].index(1) #=> 0
p [1, 0, 0, 0, 0].index(1) #=> 0
p [0, 0, 0, 0, 0].index(1) #=> nil
//}

ブロック...
...返します。
一つも真にならなかった場合は nil を返します。

//emlist[例][ruby]{
p [0, 1, 0, 1, 0].index {|v| v > 0} #=> 1
//}


引数、ブロックのどちらも与えられなかった場合は、
Enumerator のインスタンスを返します。

@see Array#rindex...

Enumerable#find_index -> Enumerator (12468.0)

条件に一致する最初の要素の位置を返します。

...指定します。

指定された val と == で等しい最初の要素の位置を返します。
等しい要素がひとつもなかった場合は nil を返します。

//emlist[例][ruby]{
(1..10).find_index(11) #=> nil
(1..10).find_index(2) #=> 1
//}

ブロックが与えられた場...
...置を返します。
一つも真にならなかった場合は nil を返します。

//emlist[例][ruby]{
(1..10).find_index {|i| i % 5 == 0 and i % 7 == 0 } #=> nil
(1..100).find_index {|i| i % 5 == 0 and i % 7 == 0 } #=> 34
//}

引数、ブロックのどちらも与えられなかった...

Integer.sqrt(n) -> Integer (12455.0)

非負整数 n の整数の平方根を返します。すなわち n の平方根以下の 最大の非負整数を返します。

...Integer ではない場合は、最初に Integer に変換されます。
@raise Math::DomainError n が負の整数の時に発生します。

//emlist[][ruby]{
Integer
.sqrt(0) # => 0
Integer
.sqrt(1) # => 1
Integer
.sqrt(24) # => 4
Integer
.sqrt(25) # => 5
Integer
.sqrt(...
...0**400) == 10**200 # => true
//}

Math.sqrt(n).floor と同等ですが、後者は浮動小数点数の精度の限界によって
真の値とは違う結果になることがあります。

//emlist[][ruby]{
Integer
.sqrt(10**46) #=> 100000000000000000000000
Math.sqrt(10**46).floor #=> 9999...

絞り込み条件を変える

Array#find_index -> Enumerator (12416.0)

条件に一致する最初の要素の位置を返します。

...定された val と == で等しい最初の要素の位置を返します。
等しい要素がひとつもなかった場合は nil を返します。

//emlist[例][ruby]{
p [1, 0, 0, 1, 0].index(1) #=> 0
p [1, 0, 0, 0, 0].index(1) #=> 0
p [0, 0, 0, 0, 0].index(1) #=> nil
//}

ブロック...
...返します。
一つも真にならなかった場合は nil を返します。

//emlist[例][ruby]{
p [0, 1, 0, 1, 0].index {|v| v > 0} #=> 1
//}


引数、ブロックのどちらも与えられなかった場合は、
Enumerator のインスタンスを返します。

@see Array#rindex...
<< 1 2 3 ... > >>