るりまサーチ

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

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

ライブラリ

モジュール

キーワード

検索結果

CMath.#sqrt(z) -> Float | Complex (18126.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)
//}...

BigMath.#sqrt(x, prec) -> BigDecimal (18114.0)

x の平方根を prec で指定した精度で計算します。

...Error x に 0 以下、もしくは NaN が指定された場合に発生します。

@raise ArgumentError prec に 0 未満が指定された場合に発生します。

//emlist[][ruby]{
require
"bigdecimal/math"

puts BigMath::sqrt(BigDecimal('2'), 10) #=> 0.1414213562373095048666666667e1
//}...

CMath.#sqrt!(x) -> Float (6142.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 (13.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...