るりまサーチ

最速Rubyリファレンスマニュアル検索!
332件ヒット [301-332件を表示] (0.067秒)

別のキーワード

  1. _builtin to_h
  2. env to_h
  3. hash to_h
  4. array to_h
  5. struct to_h

ライブラリ

キーワード

検索結果

<< < ... 2 3 4 >>

Math.#sin(x) -> Float (3002.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.#sqrt(a) -> Numeric (3002.0)

@todo

...@todo

a の正の平方根を返します。
a が Complex の時は、Complex を返します。
a が負の時は、a を正にして、その平方根を Complex の虚数部に入れて返します。
それ以外は、Math.rsqrt の結果を返します。...

Math.#sqrt(x) -> Float (3002.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.#tan(x) -> Float (3002.0)

x の正接関数(tangent)の値を返します。

...実数(ラジアンで与えます)

@return 実数

@raise TypeError x に数値以外を指定した場合に発生します。

@raise RangeError x に実数以外の数値を指定した場合に発生します。

//emlist[例][ruby]{
Math
.tan(0) # => 0.0
//}

@see Math.#atan, Math.#atan2...
<< < ... 2 3 4 >>