791件ヒット
[1-100件を表示]
(0.024秒)
ライブラリ
- ビルトイン (437)
- bigdecimal (22)
- cmath (240)
- mathn (4)
- matrix (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - E (11)
- Marshal フォーマット (11)
-
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 4 . 0 (8) - PI (11)
- Ruby用語集 (11)
- acos (17)
- acos! (6)
- acosh (17)
- acosh! (6)
- angle (22)
-
angle
_ with (11) - arg (22)
- asin (17)
- asin! (6)
- asinh (17)
- asinh! (6)
- atan (17)
- atan! (6)
- atan2 (17)
- atan2! (6)
- atanh (17)
- atanh! (6)
- bigdecimal (11)
- bsearch (22)
- cbrt (17)
- cbrt! (6)
- cos (17)
- cos! (6)
- cosh (17)
- cosh! (6)
- erf (11)
- erfc (11)
- exp (28)
- exp! (6)
- frexp (11)
- gamma (11)
- hypot (11)
- ldexp (11)
- lgamma (11)
- log (45)
- log! (12)
- log10 (17)
- log10! (6)
- log2 (17)
- log2! (6)
- mathn (4)
- phase (22)
- round (19)
- rsqrt (4)
-
ruby 1
. 6 feature (11) - sin (17)
- sin! (6)
- sinh (17)
- sinh! (6)
- sqrt (17)
- sqrt! (6)
- tan (17)
- tan! (6)
- tanh (17)
- tanh! (6)
検索結果
先頭5件
-
Float (38028.0)
-
浮動小数点数のクラス。Float の実装は C 言語の double で、その精度は環 境に依存します。
...浮動小数点数のクラス。Float の実装は C 言語の double で、その精度は環
境に依存します。
一般にはせいぜい15桁です。詳しくは多くのシステムで採用されている
浮動小数点標準規格、IEEE (Institute of Electrical and
Electronics Engine......電子技術者協会) 754 を参照してください。
//emlist[あるシステムでの 1/3(=0.333...) の結果][ruby]{
printf("%.50f\n", 1.0/3)
# => 0.33333333333333331482961625624739099293947219848633
//}
Math::PI などの数学定数については Math を
参照してください。... -
Math
. # log(x) -> Float (21168.0) -
x の対数(logarithm)を返します。
...x の対数(logarithm)を返します。
引数 x, b の両方に 0 を指定した場合は Float::NAN を返します。
@param x 正の実数を指定します。
@param b 底を指定します。省略した場合は自然対数(natural logarithm)を計算します。
@raise TypeErr......らかに負の数を指定した場合に発生します。
//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 (21168.0) -
x の対数(logarithm)を返します。
...x の対数(logarithm)を返します。
引数 x, b の両方に 0 を指定した場合は Float::NAN を返します。
@param x 正の実数を指定します。
@param b 底を指定します。省略した場合は自然対数(natural logarithm)を計算します。
@raise TypeErr......らかに負の数を指定した場合に発生します。
//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
. # log2(x) -> Float (21143.0) -
2 を底とする x の対数(binary logarithm)を返します。
...@raise Math::DomainError x に範囲外の実数を指定した場合に発生します。
@raise RangeError xに実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
Math.log2(1) # => 0.0
Math.log2(2) # => 1.0
Math.log2(32768) # => 15.0
Math.log2(65536)......# => 16.0
//}
@see Math.#log, Math.#log10... -
Math
. # log10(x) -> Float (21137.0) -
x の常用対数(common logarithm)を返します。
...se 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 Math.......#log, Math.#log2... -
Float
# round(ndigits = 0) -> Integer | Float (21126.0) -
自身ともっとも近い整数もしくは実数を返します。
...合発生します。
//emlist[例][ruby]{
1.0.round # => 1
1.2.round # => 1
(-1.2).round # => -1
(-1.5).round # => -2
t = Math::PI # => 3.141592653589793
t.round(3) # => 3.142
t.round(0) # => 3
t.round(1) # => 3.1
t = t**10 # => 93648.04747608298
t.round(-0)......d(-2) # => 93600
t.round(-3) # => 94000
t.round(-100) # => 0
2.5.round(half: :up) # => 3
2.5.round(half: :even) # => 2
2.5.round(half: :down) # => 2
3.5.round(half: :up) # => 4
3.5.round(half: :even) # => 4
3.5.round(half: :down) # => 3
//}
@see Float#ceil, Float#floor, Float#truncate... -
Float
# round(ndigits = 0 , half: :up) -> Integer | Float (21126.0) -
自身ともっとも近い整数もしくは実数を返します。
...合発生します。
//emlist[例][ruby]{
1.0.round # => 1
1.2.round # => 1
(-1.2).round # => -1
(-1.5).round # => -2
t = Math::PI # => 3.141592653589793
t.round(3) # => 3.142
t.round(0) # => 3
t.round(1) # => 3.1
t = t**10 # => 93648.04747608298
t.round(-0)......d(-2) # => 93600
t.round(-3) # => 94000
t.round(-100) # => 0
2.5.round(half: :up) # => 3
2.5.round(half: :even) # => 2
2.5.round(half: :down) # => 2
3.5.round(half: :up) # => 4
3.5.round(half: :even) # => 4
3.5.round(half: :down) # => 3
//}
@see Float#ceil, Float#floor, Float#truncate... -
Float
# round(ndigits = 0) -> Integer | Float (21125.0) -
自身ともっとも近い整数もしくは実数を返します。
...t = Math::PI # => 3.141592653589793
t.round(3) # => 3.142
t.round(0) # => 3
t.round(1) # => 3.1
t = t**10 # => 93648.04747608298
t.round(-0) # => 93648
t.round(-1) # => 93650
t.round(-2) # => 93600
t.round(-3) # => 94000
t.round(-100) # => 0
//}
@see Float#ceil, Float#flo... -
Math
. # acos(x) -> Float (21125.0) -
x の逆余弦関数(arccosine)の値をラジアンで返します。
...定した場合に発生します。
@raise Math::DomainError x に範囲外の実数を指定した場合に発生します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
Math.acos(0) == Math::PI/2 # => true
//}
@see Math.#cos... -
Math
. # asin(x) -> Float (21125.0) -
x の逆正弦関数(arcsine)の値をラジアンで返します。
...定した場合に発生します。
@raise Math::DomainError x に範囲外の実数を指定した場合に発生します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
Math.asin(1) == Math::PI/2 # => true
//}
@see Math.#sin... -
Math
. # atan2(y , x) -> Float (21125.0) -
y / x の逆正接関数(arctangent)の値をラジアンで返します。
...list[例][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...