るりまサーチ (Ruby 2.2.0)

最速Rubyリファレンスマニュアル検索!
10件ヒット [1-10件を表示] (0.171秒)
トップページ > 種類:インスタンスメソッド[x] > クエリ:l[x] > バージョン:2.2.0[x] > クエリ:d[x] > クラス:Integer[x]

別のキーワード

  1. matrix l
  2. kernel $-l
  3. _builtin $-l
  4. lupdecomposition l
  5. l

ライブラリ

キーワード

検索結果

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

自身と整数 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#floor(ndigits = 0) -> Integer | Float (18907.0)

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

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

//emlist[][ruby]{
1.floor #...

Integer#to_d -> BigDecimal (18610.0)

自身を BigDecimal に変換します。BigDecimal(self) と同じです。

自身を BigDecimal に変換します。BigDecimal(self) と同じです。

@return BigDecimal に変換したオブジェクト

Integer#ceil(ndigits = 0) -> Integer | Float (18607.0)

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

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

//emlist[][ruby]{
1.ceil # =...

Integer#downto(min) {|n| ... } -> self (18607.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#modulo(other) -> Numeric (18607.0)

算術演算子。剰余を計算します。

算術演算子。剰余を計算します。

//emlist[][ruby]{
13 % 4 # => 1
13 % -4 # => -3
-13 % 4 # => 3
-13 % -4 # => -1
//}

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

Integer#odd? -> bool (18607.0)

自身が奇数であれば真を返します。 そうでない場合は偽を返します。

自身が奇数であれば真を返します。
そうでない場合は偽を返します。

//emlist[][ruby]{
5.odd? # => true
10.odd? # => false
//}

Integer#round(ndigits = 0, half: :up) -> Integer | Float (18607.0)

self ともっとも近い整数を返します。

...合、Float を返します。
小数点以下を、最大 n 桁にします。
負の整数を指定した場合、Integer を返します。
小数点位置から左に少なくとも n 個の 0 が並びます。
@param half ちょうど半分の値の...

Integer#pow(other, modulo) -> Integer (607.0)

算術演算子。冪(べき乗)を計算します。

...に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。

//...

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

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

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

//emlist[][ruby]{
1.truncate...

絞り込み条件を変える