るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.014秒)
トップページ > バージョン:2.3.0[x] > クエリ:Math[x] > クエリ:sqrt[x] > モジュール:CMath[x]

別のキーワード

  1. math log
  2. math sqrt
  3. _builtin math
  4. bigdecimal/math sqrt
  5. bigdecimal/math sin

ライブラリ

キーワード

検索結果

CMath.#sqrt(z) -> Float | Complex (63361.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 (27493.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 (9226.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...