るりまサーチ

最速Rubyリファレンスマニュアル検索!
55件ヒット [1-55件を表示] (0.079秒)

別のキーワード

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

ライブラリ

キーワード

検索結果

Integer#numerator -> Integer (26227.0)

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

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

@return 分子を返します。

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

@see Integer#denominator...

Integer#times -> Enumerator (8208.0)

self 回だけ繰り返します。 self が正の整数でない場合は何もしません。

...self - 1 までの数値が渡されます。

//emlist[][ruby]{
3.times { puts "Hello, World!" } # Hello, World! と3行続いて表示される。
0.times { puts "Hello, World!" } # 何も表示されない。
5.times {|n| print n } # 01234 と表示される。
//}

@see Integer#upt...

Integer#downto(min) -> Enumerator (8202.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#upto(max) -> Enumerator (8202.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#denominator -> Integer (8114.0)

分母(常に1)を返します。

...分母(常に1)を返します。

@return 分母を返します。

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

@see Integer#numerator...

絞り込み条件を変える