11件ヒット
[1-11件を表示]
(0.037秒)
種類
- モジュール関数 (6)
- インスタンスメソッド (5)
検索結果
先頭5件
-
Integer
# **(other) -> Numeric (54433.0) -
算術演算子。冪(べき乗)を計算します。
算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。
//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
... -
Integer
# pow(other) -> Numeric (9133.0) -
算術演算子。冪(べき乗)を計算します。
算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。
//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
... -
Integer
# pow(other , modulo) -> Integer (9133.0) -
算術演算子。冪(べき乗)を計算します。
算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。
//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
... -
Float
# round(ndigits = 0) -> Integer | Float (43.0) -
自身ともっとも近い整数もしくは実数を返します。
自身ともっとも近い整数もしくは実数を返します。
中央値 0.5, -0.5 はそれぞれ 1,-1 に切り上げされます。
いわゆる四捨五入ですが、偶数丸めではありません。
@param ndigits 丸める位を指定します。
ndigitsが0ならば、小数点以下を四捨五入し、整数を返します。
ndigitsが0より大きいならば、小数点以下の指定された位で四捨五入されます。
ndigitsが0より小さいならば、小数点以上の指定された位で四捨五入されます。
@param half ちょうど半分の値の丸め方を指定します。
サポートされている... -
Float
# round(ndigits = 0 , half: :up) -> Integer | Float (43.0) -
自身ともっとも近い整数もしくは実数を返します。
自身ともっとも近い整数もしくは実数を返します。
中央値 0.5, -0.5 はそれぞれ 1,-1 に切り上げされます。
いわゆる四捨五入ですが、偶数丸めではありません。
@param ndigits 丸める位を指定します。
ndigitsが0ならば、小数点以下を四捨五入し、整数を返します。
ndigitsが0より大きいならば、小数点以下の指定された位で四捨五入されます。
ndigitsが0より小さいならば、小数点以上の指定された位で四捨五入されます。
@param half ちょうど半分の値の丸め方を指定します。
サポートされている... -
Marshal
. # load(port , proc = nil) -> object (43.0) -
port からマーシャルデータを読み込んで、元のオブジェクトと同 じ状態をもつオブジェクトを生成します。
port からマーシャルデータを読み込んで、元のオブジェクトと同
じ状態をもつオブジェクトを生成します。
proc として手続きオブジェクトが与えられた場合には読み込んだ
オブジェクトを引数にその手続きを呼び出します。
//emlist[例][ruby]{
str = Marshal.dump(["a", 1, 10 ** 10, 1.0, :foo])
p Marshal.load(str, proc {|obj| p obj})
# => "a"
# 1
# 10000000000
# 1.0
# :foo
# ["a", 1, 10000000000... -
Marshal
. # restore(port , proc = nil) -> object (43.0) -
port からマーシャルデータを読み込んで、元のオブジェクトと同 じ状態をもつオブジェクトを生成します。
port からマーシャルデータを読み込んで、元のオブジェクトと同
じ状態をもつオブジェクトを生成します。
proc として手続きオブジェクトが与えられた場合には読み込んだ
オブジェクトを引数にその手続きを呼び出します。
//emlist[例][ruby]{
str = Marshal.dump(["a", 1, 10 ** 10, 1.0, :foo])
p Marshal.load(str, proc {|obj| p obj})
# => "a"
# 1
# 10000000000
# 1.0
# :foo
# ["a", 1, 10000000000... -
Math
. # frexp(x) -> [Float , Integer] (43.0) -
実数 x の仮数部と指数部の配列を返します。
実数 x の仮数部と指数部の配列を返します。
@param x 実数
@raise TypeError x に数値以外を指定した場合に発生します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
fraction, exponent = Math.frexp(1234) # => [0.6025390625, 11]
fraction * 2**exponent # => 1234.0
//} -
Math
. # log(x) -> Float (43.0) -
x の対数(logarithm)を返します。
x の対数(logarithm)を返します。
引数 x, b の両方に 0 を指定した場合は Float::NAN を返します。
@param x 正の実数を指定します。
@param b 底を指定します。省略した場合は自然対数(natural logarithm)を計算します。
@raise TypeError 引数のどちらかに数値以外を指定した場合に発生します。
@raise RangeError 引数のどちらかに実数以外の数値を指定した場合に発生します。
@raise DomainError 引数のどちらかに負の数を指定した場合に発生します。
//emlist[例][ru... -
Math
. # log(x , b) -> Float (43.0) -
x の対数(logarithm)を返します。
x の対数(logarithm)を返します。
引数 x, b の両方に 0 を指定した場合は Float::NAN を返します。
@param x 正の実数を指定します。
@param b 底を指定します。省略した場合は自然対数(natural logarithm)を計算します。
@raise TypeError 引数のどちらかに数値以外を指定した場合に発生します。
@raise RangeError 引数のどちらかに実数以外の数値を指定した場合に発生します。
@raise DomainError 引数のどちらかに負の数を指定した場合に発生します。
//emlist[例][ru... -
Math
. # log10(x) -> Float (43.0) -
x の常用対数(common logarithm)を返します。
x の常用対数(common logarithm)を返します。
@param x 正の実数
@raise TypeError xに数値以外を指定した場合に発生します。
@raise Math::DomainError x に範囲外の実数を指定した場合に発生します。
@raise RangeError xに実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
Math.log10(1) # => 0.0
Math.log10(10) # => 1.0
Math.log10(10**100) # => 100.0
//}
@see M...