893件ヒット
[1-100件を表示]
(0.122秒)
ライブラリ
- ビルトイン (605)
- bigdecimal (24)
-
bigdecimal
/ math (72) - cmath (84)
- matrix (12)
モジュール
- BigMath (96)
- CMath (78)
- Enumerable (48)
- Kernel (24)
- Math (276)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - CMath (6)
- E (24)
- Float (12)
- Marshal フォーマット (12)
-
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 4 . 0 (9) - PI (24)
- acos (12)
- angle (36)
-
angle
_ with (12) - arg (36)
- asin (12)
- atan (24)
- atan2 (12)
- bigdecimal (12)
-
bigdecimal
/ math (12) - bsearch (24)
- cbrt (18)
- cbrt! (6)
- cos (24)
- cos! (6)
- digits (24)
- erf (12)
- erfc (12)
- exp (30)
- exp! (6)
- frexp (12)
- gamma (12)
- hypot (12)
- ldexp (12)
- lgamma (12)
- log (48)
- log! (12)
- log10 (12)
- log2 (12)
- mathn (4)
-
max
_ by (48) -
module
_ function (36) - phase (36)
- polar (12)
- printf (24)
- round (21)
-
ruby 1
. 6 feature (12) -
ruby 1
. 9 feature (12) - sin (24)
- sin! (6)
- sqrt (38)
- sqrt! (6)
- tan (12)
- tan! (6)
検索結果
先頭5件
-
Math (44024.0)
-
浮動小数点演算をサポートするモジュールです。
...浮動小数点演算をサポートするモジュールです。
Math モジュールにはさまざま数学関数がモジュール関数として定義されています。
モジュール関数は以下のように,モジュールの特異メソッドとして呼び出す使い方と、
モ......ジュールをインクルードしてレシーバーを省略した形で呼び出す使い方の両方ができます。
=== 例
//emlist[][ruby]{
pi = Math.atan2(1, 1)*4;
include Math
pi2 = atan2(1, 1)*4
//}... -
Math
. # atan2(y , x) -> Float (27130.0) -
y / x の逆正接関数(arctangent)の値をラジアンで返します。
...逆正接関数(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
. # sqrt(x) -> Float (27130.0) -
x の非負の平方根(principal square root)を返します。
...x の非負の平方根(principal square root)を返します。
@param x 0または正の実数
@raise TypeError xに数値以外を指定した場合に発生します。
@raise Math::DomainError x に範囲外の実数を指定した場合に発生します。
@raise RangeError xに実......数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
0.upto(10) {|x|
p [x, Math.sqrt(x), Math.sqrt(x)**2]
}
# => [0, 0.0, 0.0]
# [1, 1.0, 1.0]
# [2, 1.4142135623731, 2.0]
# [3, 1.73205080756888, 3.0]
# [4, 2.0, 4.0]
# [5, 2.23606797749979, 5.0]
# [6, 2.449......48974278318, 6.0]
# [7, 2.64575131106459, 7.0]
# [8, 2.82842712474619, 8.0]
# [9, 3.0, 9.0]
# [10, 3.16227766016838, 10.0]
//}
@see Integer.sqrt, Math.#cbrt... -
Math
. # atan(x) -> Float (27124.0) -
x の逆正接関数(arctangent)の値をラジアンで返します。
...x の逆正接関数(arctangent)の値をラジアンで返します。
@param x 実数
@return 返される値の範囲は [-π/2, +π/2] です。
@raise TypeError x に数値以外を指定した場合に発生します。
@raise RangeError x に実数以外の数値を指定した場合......に発生します。
//emlist[例][ruby]{
Math.atan(0) # => 0.0
//}
@see Math.#atan2, Math.#tan... -
Math
. # cbrt(x) -> Float (27124.0) -
x の立方根(cubic root)を返します。
...(cubic root)を返します。
@param x 実数
@raise TypeError xに数値以外を指定した場合に発生します。
@raise RangeError xに実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
-9.upto(9) {|x|
p [x, Math.cbrt(x), Math.cbrt(x)**3]
}
# =>.......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.0800838230519, 9.0]
//}
@see Math.#sqrt... -
Math
. # tan(x) -> Float (27124.0) -
x の正接関数(tangent)の値を返します。
...(tangent)の値を返します。
@param x 実数(ラジアンで与えます)
@return 実数
@raise TypeError x に数値以外を指定した場合に発生します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
Math.tan......(0) # => 0.0
//}
@see Math.#atan, Math.#atan2... -
Math
. # hypot(x , y) -> Float (27112.0) -
sqrt(x*x + y*y) を返します。
...sqrt(x*x + y*y) を返します。
この値は x, y を直交する 2 辺とする直角三角形の斜辺(hypotenuse)の長さです。
@param x 実数
@param y 実数
@raise TypeError 引数のどちらかに数値以外を指定した場合に発生します。
@raise RangeError 引数......のどちらかに実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
Math.hypot(3, 4) #=> 5.0
//}... -
Math
. # log(x) -> Float (24166.0) -
x の対数(logarithm)を返します。
...数(logarithm)を返します。
引数 x, b の両方に 0 を指定した場合は Float::NAN を返します。
@param x 正の実数を指定します。
@param b 底を指定します。省略した場合は自然対数(natural logarithm)を計算します。
@raise TypeError 引数......らかに負の数を指定した場合に発生します。
//emlist[例][ruby]{
Math.log(0) # => -Infinity
Math.log(1) # => 0.0
Math.log(Math::E) # => 1.0
Math.log(Math::E**3) # => 3.0
Math.log(12, 3) # => 2.2618595071429146
//}
@see Math.#log2, Math.#log10, Math.#exp... -
Math
. # log(x , b) -> Float (24166.0) -
x の対数(logarithm)を返します。
...数(logarithm)を返します。
引数 x, b の両方に 0 を指定した場合は Float::NAN を返します。
@param x 正の実数を指定します。
@param b 底を指定します。省略した場合は自然対数(natural logarithm)を計算します。
@raise TypeError 引数......らかに負の数を指定した場合に発生します。
//emlist[例][ruby]{
Math.log(0) # => -Infinity
Math.log(1) # => 0.0
Math.log(Math::E) # => 1.0
Math.log(Math::E**3) # => 3.0
Math.log(12, 3) # => 2.2618595071429146
//}
@see Math.#log2, Math.#log10, Math.#exp...