3件ヒット
[1-3件を表示]
(0.057秒)
検索結果
-
CMath
. # sqrt(z) -> Float | Complex (54664.0) -
z の平方根を返します。
...z の平方根を返します。
@param z 数値
@raise TypeError z に数値以外を指定した場合に発生します。
//emlist[例][ruby]{
require "cmath"
CMath.sqrt(-1) # => (0+1.0i)
CMath.sqrt(1)# => 1.0
CMath.sqrt(Complex(0, 8))# => (2.0+2.0i)
//}... -
CMath
. # sqrt!(x) -> Float (18712.0) -
実数 x の平方根を返します。Math.#sqrt のエイリアスです。
...に発生します。
@raise TypeError x に数値以外を指定した場合に発生します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
require "cmath"
CMath.sqrt!(4.0) # => 2.0
CMath.sqrt!(9.0) # => 3.0
//}
@see Math.#sqrt... -
CMath
. # exp!(x) -> Float (325.0) -
実数 x の指数関数(Math::E の x 乗)の値を返します。 Math.#exp のエイリアスです。
...た場合に発生します。
@raise RangeError x に実数以外の数値を指定した場合に発生します。
//emlist[例][ruby]{
require "cmath"
CMath.exp!(0) # => 1
CMath.exp!(0.5) # => Math.sqrt(Math::E)
CMath.exp!(1) # => Math::E
CMath.exp!(2) # => Math::E ** 2
//}
@see Math.#exp...