るりまサーチ

最速Rubyリファレンスマニュアル検索!
722件ヒット [501-600件を表示] (0.107秒)
トップページ > クエリ:ruby[x] > クエリ:Ruby[x] > 種類:インスタンスメソッド[x] > クエリ:i[x] > クエリ:@[x] > クラス:Integer[x]

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

キーワード

検索結果

<< < ... 4 5 6 7 8 > >>

Integer#numerator -> Integer (3126.0)

分子(常に自身)を返します。

...分子(常に自身)を返します。

@
return 分子を返します。

//emlist[][ruby]{
10.numerator # => 10
-10.numerator # => -10
//}

@
see Integer#denominator...

Integer#truncate(ndigits = 0) -> Integer (3126.0)

0 から self までの整数で、自身にもっとも近い整数を返します。

...も近い整数を返します。

@
param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
負の整数を指定した場合、小数点位置から左に少なくとも n 個の 0 が並びます。

//emlist[][ruby]{
1.truncate # => 1
1.tr...
...uncate(2) # => 1
18.truncate(-1) # => 10
(-18).truncate(-1) # => -10
//}

@
see Numeric#truncate...

Integer#truncate(ndigits = 0) -> Integer | Float (3126.0)

0 から self までの整数で、自身にもっとも近い整数を返します。

...

@
param ndigits 10進数での小数点以下の有効桁数を整数で指定します。
正の整数を指定した場合、Float を返します。
小数点以下を、最大 n 桁にします。
負の整数を指定した場合、Integer を返...
...します。
小数点位置から左に少なくとも n 個の 0 が並びます。

//emlist[][ruby]{
1.truncate # => 1
1.truncate(2) # => 1.0
18.truncate(-1) # => 10
(-18).truncate(-1) # => -10
//}

@
see Numeric#truncate...

Integer#&(other) -> Integer (3120.0)

ビット二項演算子。論理積を計算します。

...ビット二項演算子。論理積を計算します。

@
param other 数値

//emlist[][ruby]{
1 & 1 # => 1
2 & 3 # => 2
//}...

Integer#<<(bits) -> Integer (3120.0)

シフト演算子。bits だけビットを左にシフトします。

...シフト演算子。bits だけビットを左にシフトします。

@
param bits シフトさせるビット数

//emlist[][ruby]{
printf("%#b\n", 0b0101 << 1) # => 0b1010
p -1 << 1 # => -2
//}...

絞り込み条件を変える

Integer#>>(bits) -> Integer (3120.0)

シフト演算子。bits だけビットを右にシフトします。

...子。bits だけビットを右にシフトします。

右シフトは、符号ビット(最上位ビット(MSB))が保持されます。
bitsが実数の場合、小数点以下を切り捨てた値でシフトします。

@
param bits シフトさせるビット数

//emlist[][ruby]{
printf("%#...

Integer#^(other) -> Integer (3120.0)

ビット二項演算子。排他的論理和を計算します。

...ビット二項演算子。排他的論理和を計算します。

@
param other 数値

//emlist[][ruby]{
1 ^ 1 # => 0
2 ^ 3 # => 1
//}...

Integer#next -> Integer (3120.0)

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

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

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

@
see Integer#pred...

Integer#ord -> Integer (3120.0)

自身を返します。

...自身を返します。

//emlist[][ruby]{
10.ord #=> 10
# String#ord
?a.ord #=> 97
//}

@
see String#ord...

Integer#pred -> Integer (3120.0)

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

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

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

@
see Integer#next...

絞り込み条件を変える

<< < ... 4 5 6 7 8 > >>