ライブラリ
- ビルトイン (661)
- bigdecimal (33)
-
bigdecimal
/ math (66) - cmath (246)
-
irb
/ ext / math-mode (12) -
irb
/ extend-command (11) - mathn (8)
- matrix (11)
- rake (11)
クラス
- Complex (44)
- Float (52)
-
IRB
:: Context (12) - Integer (29)
- Module (30)
- Numeric (44)
-
Rake
:: FileList (11) - Range (22)
- Vector (11)
モジュール
- BigMath (88)
- CMath (240)
- Enumerable (44)
-
IRB
:: ContextExtender (11) - Kernel (22)
- Math (327)
オブジェクト
- main (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - BigMath (11)
- CMath (6)
- DomainError (11)
- E (22)
- Float (11)
- Marshal フォーマット (11)
-
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 4 . 0 (8) - PI (22)
- Random (11)
- Ruby用語集 (11)
- acos (17)
- acos! (6)
- acosh (17)
- acosh! (6)
- angle (33)
-
angle
_ with (11) - arg (33)
- asin (17)
- asin! (6)
- asinh (17)
- asinh! (6)
- atan (28)
- atan! (6)
- atan2 (17)
- atan2! (6)
- atanh (17)
- atanh! (6)
- bigdecimal (11)
-
bigdecimal
/ math (11) - bsearch (22)
- cbrt (17)
- cbrt! (6)
- cmath (6)
- cos (28)
- cos! (6)
- cosh (17)
- cosh! (6)
- digits (22)
- erf (11)
- erfc (11)
- exp (28)
- exp! (6)
- frexp (11)
- gamma (11)
- hypot (11)
- include (33)
-
install
_ extend _ commands (11) - irb (4)
-
irb
/ ext / math-mode (4) - ldexp (11)
- lgamma (11)
- log (45)
- log! (12)
- log10 (17)
- log10! (6)
- log2 (17)
- log2! (6)
- math? (4)
-
math
_ mode (4) -
math
_ mode= (4) - mathn (4)
-
max
_ by (44) -
module
_ function (19) - phase (33)
- polar (22)
- printf (22)
- round (19)
- rsqrt (4)
-
ruby 1
. 6 feature (11) -
ruby 1
. 9 feature (11) - sin (28)
- sin! (6)
- sinh (17)
- sinh! (6)
- sqrt (39)
- sqrt! (6)
- tan (17)
- tan! (6)
- tanh (17)
- tanh! (6)
- メソッド呼び出し(super・ブロック付き・yield) (11)
検索結果
先頭5件
-
Math
. # sqrt(x) -> Float (21024.0) -
x の非負の平方根(principal square root)を返します。
...合に発生します。
@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.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.44948974278318, 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 (21018.0) -
x の逆正接関数(arctangent)の値をラジアンで返します。
...rn 返される値の範囲は [-π/2, +π/2] です。
@raise TypeError x に数値以外を指定した場合に発生します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
Math.atan(0) # => 0.0
//}
@see Math.#atan2, Math.#tan... -
Math
. # cbrt(x) -> Float (21018.0) -
x の立方根(cubic root)を返します。
...す。
@raise RangeError xに実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
-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]
#.......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
. # cos(x) -> Float (21018.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 (21018.0) -
x のガンマ関数の値を返します。
...。
@raise 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),......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] (21018.0) -
log(|gamma(x)|) と、gamma(x) の符号を返します。
...数値以外を指定した場合に発生します。
@raise Math::DomainError x に -∞ を渡した場合に発生します。
@raise RangeError xに実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
Math.lgamma(0) # => [Infinity, 1]
//}
@see Math.#gamma... -
Math
. # sin(x) -> Float (21018.0) -
x の正弦関数(sine)の値を返します。
...ラジアンで与えます)
@return [-1, 1] の実数
@raise TypeError x に数値以外を指定した場合に発生します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
Math.sin(Math::PI/2) # => 1.0
//}
@see Math.#asin... -
Math
. # tan(x) -> Float (21018.0) -
x の正接関数(tangent)の値を返します。
...実数(ラジアンで与えます)
@return 実数
@raise TypeError x に数値以外を指定した場合に発生します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
Math.tan(0) # => 0.0
//}
@see Math.#atan, Math.#atan2... -
Math
. # acosh(x) -> Float (21012.0) -
x の逆双曲線余弦関数(area hyperbolic cosine)の値を返します。
...>= 1 の範囲の実数
@raise TypeError x に数値以外を指定した場合に発生します。
@raise Math::DomainError x に範囲外の実数を指定した場合に発生します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
@see Math.#cosh... -
Math
. # atanh(x) -> Float (21012.0) -
x の逆双曲線正接関数(area hyperbolic tangent)の値を返します。
...実数
@return 実数
@raise TypeError x に数値以外を指定した場合に発生します。
@raise Math::DomainError x に範囲外の実数を指定した場合に発生します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
@see Math.#tanh...