るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Integer#integer? -> true (35220.0)

常に真を返します。

...常に真を返します。

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

Integer.sqrt(n) -> Integer (29155.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(...
...10**400) == 10**200 # => true
//}

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

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

Integer#anybits?(mask) -> bool (29046.0)

self & mask のいずれかのビットが 1 なら true を返します。

...が 1 なら true を返します。

self & mask != 0 と等価です。

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

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

@see Integer#allbits?
@see Integer#nobits?...

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

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

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

self & mask == 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 Integer#anybits?
@see Integer#nobits?...

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

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

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

self & mask == 0 と等価です。

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

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

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

絞り込み条件を変える

Integer#<=(other) -> bool (29018.0)

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

...other 比較対象の数値
@return self よりも other の方が大きい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。

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

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

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

...other 比較対象の数値
@return self よりも other の方が小さい場合か、
両者が等しい場合 true を返します。
そうでなければ false を返します。

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

Integer#<(other) -> bool (29012.0)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

絞り込み条件を変える

Integer#>(other) -> bool (29012.0)

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

...演算子。数値として大きいか判定します。

@param other 比較対象の数値
@return self よりも other の方が小さい場合 true を返します。
そうでなければ false を返します。

//emlist[][ruby]{
1 > 0 # => true
1 > 1 # => false
//}...
<< 1 2 3 ... > >>