るりまサーチ

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

別のキーワード

  1. cmath log!
  2. cmath log
  3. cmath sqrt!
  4. cmath cbrt

ライブラリ

モジュール

キーワード

検索結果

CMath.#sqrt(z) -> Float | Complex (35144.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 (23154.0)

実数 x の平方根を返します。Math.#sqrt のエイリアスです。

...実数 x の平方根を返します。Math.#sqrt のエイリアスです。

@param x 正の実数

@raise Math::DomainError x が負の数である場合に発生します。

@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 (17037.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...