るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

<< < 1 2 3 4 ... > >>

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

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

...
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#ste...
...p, Integer#times...

Integer#times -> Enumerator (53.0)

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

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

またブロックパラメータには 0 から self - 1 までの数値が渡されます。

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

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

Integer#ceildiv(other) -> Integer (52.0)

self を other で割り、その(剰余を考えない)商を整数に切り上げたものを返します。 すなわち、self を other で割った商を q とすると、q 以上で最小の整数を返します。

...
self
を other で割り、その(剰余を考えない)商を整数に切り上げたものを返します。
すなわち、self を other で割った商を q とすると、q 以上で最小の整数を返します。

@param other self を割る数を指定します。

//emlist[][ruby]{
3.cei...

Integer#upto(max) -> Enumerator (52.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 (52.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#digits -> [Integer] (48.0)

base を基数として self を位取り記数法で表記した数値を配列で返します。 base を指定しない場合の基数は 10 です。

...base を基数として self を位取り記数法で表記した数値を配列で返します。
base を指定しない場合の基数は 10 です。

//emlist[][ruby]{
16.digits # => [6, 1]
16.digits(16) # => [0, 1]
//}

self
は非負整数でなければいけません。非負整数で...
...ない場合は、Math::DomainErrorが発生します。

//emlist[][ruby]{
-10.digits # Math::DomainError: out of domain が発生
//}

@return 位取り記数法で表した時の数値の配列
@param base 基数となる数値。
@raise ArgumentError base に正の整数以外を指定し...

Integer#digits(base) -> [Integer] (48.0)

base を基数として self を位取り記数法で表記した数値を配列で返します。 base を指定しない場合の基数は 10 です。

...base を基数として self を位取り記数法で表記した数値を配列で返します。
base を指定しない場合の基数は 10 です。

//emlist[][ruby]{
16.digits # => [6, 1]
16.digits(16) # => [0, 1]
//}

self
は非負整数でなければいけません。非負整数で...
...ない場合は、Math::DomainErrorが発生します。

//emlist[][ruby]{
-10.digits # Math::DomainError: out of domain が発生
//}

@return 位取り記数法で表した時の数値の配列
@param base 基数となる数値。
@raise ArgumentError base に正の整数以外を指定し...

Integer#<=>(other) -> -1 | 0 | 1 | nil (46.0)

self と other を比較して、self が大きい時に1、等しい時に 0、小さい時 に-1、比較できない時に nil を返します。

...
self
と other を比較して、self が大きい時に1、等しい時に 0、小さい時
に-1、比較できない時に nil を返します。

@param other 比較対象の数値
@return -1 か 0 か 1 か nil のいずれか

//emlist[][ruby]{
1 <=> 2 # => -1
1 <=> 1 # => 0
2 <=> 1 #...

Integer#gcdlcm(n) -> [Integer] (46.0)

自身と整数 n の最大公約数と最小公倍数の配列 [self.gcd(n), self.lcm(n)] を返します。

...自身と整数 n の最大公約数と最小公倍数の配列 [self.gcd(n), self.lcm(n)]
を返します。

@raise ArgumentError n に整数以外のものを指定すると発生します。

//emlist[][ruby]{
2.gcdlcm(2) # => [2, 2]
3.gcdlcm(-7) # => [1, 21...
...]
((1<<31)-1).gcdlcm((1<<61)-1) # => [1, 4951760154835678088235319297]
//}

@see Integer#gcd, Integer#lcm...

Integer#remainder(other) -> Numeric (42.0)

self を other で割った余り r を返します。

...
self
を other で割った余り r を返します。

r の符号は self と同じになります。

@param other self を割る数。

//emlist[][ruby]{
5.remainder(3) # => 2
-5.remainder(3) # => -2
5.remainder(-3) # => 2
-5.remainder(-3) # => -2

-1234567890987654321.remainder(13731...
...) # => -6966
-1234567890987654321.remainder(13731.24) # => -9906.22531493148
//}

@see Integer#divmod, Integer#modulo, Numeric#modulo...

絞り込み条件を変える

<< < 1 2 3 4 ... > >>