るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

<< < ... 3 4 5 6 7 ... > >>

Integer#downto(min) -> Enumerator (132.0)

self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。 self < min であれば何もしません。

...で 1 ずつ減らしながらブロックを繰り返し実行します。
self < min であれば何もしません。

@
param min 数値
@
return self を返します。

//emlist[][ruby]{
5.downto(1) {|i| print i, " " } # => 5 4 3 2 1
//}

@
see Integer#upto, Numeric#step, Integer#times...

Integer#downto(min) {|n| ... } -> self (132.0)

self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。 self < min であれば何もしません。

...で 1 ずつ減らしながらブロックを繰り返し実行します。
self < min であれば何もしません。

@
param min 数値
@
return self を返します。

//emlist[][ruby]{
5.downto(1) {|i| print i, " " } # => 5 4 3 2 1
//}

@
see Integer#upto, Numeric#step, Integer#times...

Integer#floor(ndigits = 0) -> Integer (132.0)

self と等しいかより小さな整数のうち最大のものを返します。

...

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

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

@
see Numeric#floor...

Integer#floor(ndigits = 0) -> Integer | Float (132.0)

self と等しいかより小さな整数のうち最大のものを返します。

...

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

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

@
see Numeric#floor...

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

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

...

@
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#any...

絞り込み条件を変える

Integer#truncate(ndigits = 0) -> Integer (132.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 (132.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#upto(max) -> Enumerator (132.0)

self から max まで 1 ずつ増やしながら繰り返します。 self > max であれば何もしません。

...self から max まで 1 ずつ増やしながら繰り返します。
self > max であれば何もしません。

@
param max 数値
@
return self を返します。

//emlist[][ruby]{
5.upto(10) {|i| print i, " " } # => 5 6 7 8 9 10
//}

@
see Integer#downto, Numeric#step, Integer#times...

Integer#upto(max) {|n| ... } -> Integer (132.0)

self から max まで 1 ずつ増やしながら繰り返します。 self > max であれば何もしません。

...self から max まで 1 ずつ増やしながら繰り返します。
self > max であれば何もしません。

@
param max 数値
@
return self を返します。

//emlist[][ruby]{
5.upto(10) {|i| print i, " " } # => 5 6 7 8 9 10
//}

@
see Integer#downto, Numeric#step, Integer#times...

Integer#*(other) -> Numeric (126.0)

算術演算子。積を計算します。

...算術演算子。積を計算します。

@
param other 二項演算の右側の引数(対象)
@
return 計算結果

//emlist[][ruby]{
2 * 3 # => 6
//}...

絞り込み条件を変える

Integer#+(other) -> Numeric (126.0)

算術演算子。和を計算します。

...算術演算子。和を計算します。

@
param other 二項演算の右側の引数(対象)
@
return 計算結果

//emlist[][ruby]{
3 + 4 # => 7
//}...

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

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

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

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

//emlist[][ruby]{
1 < 1 # => false
1 < 2 # => true
//}...
<< < ... 3 4 5 6 7 ... > >>