るりまサーチ

最速Rubyリファレンスマニュアル検索!
262件ヒット [201-262件を表示] (0.086秒)
トップページ > クラス:Integer[x] > ライブラリ:ビルトイン[x] > クエリ:numeric[x] > クエリ:i[x] > クエリ:-[x]

別のキーワード

  1. numeric step
  2. _builtin numeric
  3. numeric i
  4. numeric abs
  5. numeric -@

キーワード

検索結果

<< < 1 2 3 >>

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

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

...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#ti...

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

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

...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#ti...

Integer#upto(max) {|n| ... } -> Integer (3221.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#floor(ndigits = 0) -> Integer (3215.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 (3215.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#truncate(ndigits = 0) -> Integer (3215.0)

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

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

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

@see Numeric#truncate...

Integer#truncate(ndigits = 0) -> Integer | Float (3215.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 (3121.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...
<< < 1 2 3 >>