るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

BigDecimal#modulo(n) -> BigDecimal (32221.0)

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

...指定します。

//emlist[][ruby]{
require 'bigdecimal'
x = BigDecimal((2**100).to_s)
( x % 3).to_i # => 1
(-x % 3).to_i # => 2
( x % -3).to_i # => -2
(-x % -3).to_i # => -1
//}

戻り値は n と同じ符号になります。これは BigDecimal#remainder とは
異なる点に注意してく...

BigDecimal#%(n) -> BigDecimal (17121.0)

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

...指定します。

//emlist[][ruby]{
require 'bigdecimal'
x = BigDecimal((2**100).to_s)
( x % 3).to_i # => 1
(-x % 3).to_i # => 2
( x % -3).to_i # => -2
(-x % -3).to_i # => -1
//}

戻り値は n と同じ符号になります。これは BigDecimal#remainder とは
異なる点に注意してく...

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

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

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

@param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外...
...数になりそうなとき、警告を出したうえで Float::INFINITY を返します。

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

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

@see BigDecimal#power...

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

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

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

@param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外...
...数になりそうなとき、警告を出したうえで Float::INFINITY を返します。

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

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

@see BigDecimal#power...

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

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

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

@param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外...
...数になりそうなとき、警告を出したうえで Float::INFINITY を返します。

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

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

@see BigDecimal#power...

絞り込み条件を変える