356件ヒット
[1-100件を表示]
(0.063秒)
検索結果
先頭5件
-
Math
. # cbrt(x) -> Float (215.0) -
x の立方根(cubic root)を返します。
...uby]{
-9.upto(9) {|x|
p [x, Math.cbrt(x), Math.cbrt(x)**3]
}
# => [-9, -2.0800838230519, -9.0]
# [-8, -2.0, -8.0]
# [-7, -1.91293118277239, -7.0]
# [-6, -1.81712059283214, -6.0]
# [-5, -1.7099759466767, -5.0]
# [-4, -1.5874010519682, -4.0]
# [-3, -1.44224957030741, -3.0]
# [-2, -1.25......992104989487, -2.0]
# [-1, -1.0, -1.0]
# [0, 0.0, 0.0]
# [1, 1.0, 1.0]
# [2, 1.25992104989487, 2.0]
# [3, 1.44224957030741, 3.0]
# [4, 1.5874010519682, 4.0]
# [5, 1.7099759466767, 5.0]
# [6, 1.81712059283214, 6.0]
# [7, 1.91293118277239, 7.0]
# [8, 2.0, 8.0]
# [9, 2.08008382305......19, 9.0]
//}
@see Math.#sqrt... -
Math
. # atanh(x) -> Float (113.0) -
x の逆双曲線正接関数(area hyperbolic tangent)の値を返します。
...t)の値を返します。
=== 定義
atanh(x) = log((1+x)/(1-x)) / 2 [-1 < x < 1]
@param x -1 < x < 1 の実数
@return 実数
@raise TypeError x に数値以外を指定した場合に発生します。
@raise Math::DomainError x に範囲外の実数を指定した場合に発生......します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
@see Math.#tanh... -
Math
. # acos(x) -> Float (107.0) -
x の逆余弦関数(arccosine)の値をラジアンで返します。
...cosine)の値をラジアンで返します。
@param x -1.0 <= x <= 1 の範囲内の実数
@return 返される値の範囲は [0, +π] です。
@raise TypeError x に数値以外を指定した場合に発生します。
@raise Math::DomainError x に範囲外の実数を指定した場合......に発生します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
Math.acos(0) == Math::PI/2 # => true
//}
@see Math.#cos... -
Math
. # acosh(x) -> Float (107.0) -
x の逆双曲線余弦関数(area hyperbolic cosine)の値を返します。
...osine)の値を返します。
=== 定義
acosh(x) = log(x + sqrt(x * x - 1)) [x >= 1]
@param x x >= 1 の範囲の実数
@raise TypeError x に数値以外を指定した場合に発生します。
@raise Math::DomainError x に範囲外の実数を指定した場合に発生します。......@raise RangeError x に実数以外の数値を指定した場合に発生します。
@see Math.#cosh... -
Math
. # asin(x) -> Float (107.0) -
x の逆正弦関数(arcsine)の値をラジアンで返します。
...sine)の値をラジアンで返します。
@param x -1.0 <= x <= 1 の範囲内の実数
@return 返される値の範囲は[-π/2, +π/2] です。
@raise TypeError x に数値以外を指定した場合に発生します。
@raise Math::DomainError x に範囲外の実数を指定した場......合に発生します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
Math.asin(1) == Math::PI/2 # => true
//}
@see Math.#sin... -
Math
. # atan2(y , x) -> Float (107.0) -
y / x の逆正接関数(arctangent)の値をラジアンで返します。
...アンで返します。
@param y 実数
@param x 実数
@return 返される値の範囲は [-π, π] です。
//emlist[例][ruby]{
Math.atan2(1,0) #=> 1.5707963267949
Math.atan2(-1,0) #=> -1.5707963267949
//}
@raise TypeError y, x に数値以外を指定した場合に発生します。......@raise RangeError y, x に実数以外の数値を指定した場合に発生します。
@see Math.#atan, Math.#tan... -
Math
. # cos(x) -> Float (107.0) -
x の余弦関数(cosine)の値を返します。
...(ラジアンで与えます)
@return [-1, 1] の実数
@raise TypeError x に数値以外を指定した場合に発生します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
Math.cos(Math::PI) # => -1.0
//}
@see Math.#acos... -
Math
. # gamma(x) -> Float (107.0) -
x のガンマ関数の値を返します。
...se Math::DomainError x に負の整数、もしくは -∞ を渡した場合に発生します。
@raise RangeError xに実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
def fact(n) (1..n).inject(1) {|r,i| r*i } end
1.upto(26) {|i| p [i, Math.gamma(i), fact(i-1)......09094217170944e+19, 51090942171709440000]
# [23, 1.1240007277776077e+21, 1124000727777607680000]
# [24, 2.5852016738885062e+22, 25852016738884976640000]
# [25, 6.204484017332391e+23, 620448401733239439360000]
# [26, 1.5511210043330954e+25, 15511210043330985984000000]
//}
@see Math.#lgamma... -
Math
. # lgamma(x) -> [Float , Integer] (107.0) -
log(|gamma(x)|) と、gamma(x) の符号を返します。
...x)|) と、gamma(x) の符号を返します。
符号は +1 もしくは -1 で返されます。
@param x 実数
@raise TypeError xに数値以外を指定した場合に発生します。
@raise Math::DomainError x に -∞ を渡した場合に発生します。
@raise RangeError xに実数......以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
Math.lgamma(0) # => [Infinity, 1]
//}
@see Math.#gamma...