るりまサーチ

最速Rubyリファレンスマニュアル検索!
44件ヒット [1-44件を表示] (0.037秒)
トップページ > クエリ:BigDecimal[x] > クエリ:-[x] > クラス:Integer[x]

別のキーワード

  1. bigdecimal/util to_d
  2. bigdecimal round
  3. bigdecimal div
  4. bigdecimal to_s
  5. bigdecimal mode

ライブラリ

キーワード

検索結果

Integer#to_d -> BigDecimal (240.0)

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

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

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

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

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

...pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。

//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
3.pow(3, 8) # => 3
3.pow(3, -8) # => -5
3.pow(2, -2) # => -1
-
3.pow(3, 8...
...) # => 5
-
3.pow(3, -8) # => -3
5.pow(2, -8) # => -7
//}

結果が巨大すぎる整数になりそうなとき、警告を出したうえで Float::INFINITY を返します。

//emlist[計算を放棄して Float::INFINITY を返す例][ruby]{
p 100**9999999
# => warning: in a**b, b may be too b...
...ig
# Infinity
//}

判定の閾値は変わりえます。

@see BigDecimal#power...

Integer#pow(other) -> Numeric (167.0)

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

...pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。

//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
3.pow(3, 8) # => 3
3.pow(3, -8) # => -5
3.pow(2, -2) # => -1
-
3.pow(3, 8...
...) # => 5
-
3.pow(3, -8) # => -3
5.pow(2, -8) # => -7
//}

結果が巨大すぎる整数になりそうなとき、警告を出したうえで Float::INFINITY を返します。

//emlist[計算を放棄して Float::INFINITY を返す例][ruby]{
p 100**9999999
# => warning: in a**b, b may be too b...
...ig
# Infinity
//}

判定の閾値は変わりえます。

@see BigDecimal#power...

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

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

...pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。

//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
3.pow(3, 8) # => 3
3.pow(3, -8) # => -5
3.pow(2, -2) # => -1
-
3.pow(3, 8...
...) # => 5
-
3.pow(3, -8) # => -3
5.pow(2, -8) # => -7
//}

結果が巨大すぎる整数になりそうなとき、警告を出したうえで Float::INFINITY を返します。

//emlist[計算を放棄して Float::INFINITY を返す例][ruby]{
p 100**9999999
# => warning: in a**b, b may be too b...
...ig
# Infinity
//}

判定の閾値は変わりえます。

@see BigDecimal#power...