るりまサーチ

最速Rubyリファレンスマニュアル検索!
18件ヒット [1-18件を表示] (0.035秒)
トップページ > クエリ:-[x] > ライブラリ:cmath[x] > クエリ:cbrt[x]

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method gets
  4. irb/input-method new
  5. matrix -

モジュール

キーワード

検索結果

CMath.#cbrt(z) -> Float | Complex (18209.0)

z の立方根の内、主値を返します。

...z の立方根の内、主値を返します。

@param z 数値

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

//emlist[例][ruby]{
require "cmath"
CMath
.cbrt(-8)# => (1.0000000000000002+1.7320508075688772i)
//}


@see Complex#**...

CMath.#cbrt!(x) -> Float (6243.0)

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

...th.#cbrt のエイリアスです。

@param x 実数

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

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

//emlist[例][ruby]{
require "cmath"
CMath
.cbrt!(8.0)# => 2.0
CMath
.cbrt!(-8.0)...
...# => -2.0
//}

@see Math.#cbrt...

CMath (50.0)

複素数演算をサポートするモジュールです。

...cmath"

# 複素数の範囲の立方根(の主値)= exp(1/3 πi)
CMath
.cbrt(-1) # => (0.5000000000000001+0.8660254037844386i)

# 実数の範囲の立方根
Math.cbrt(-1) # => -1.0

include CMath

# レシーバー無しで使える
cbrt
(-1) # => (0.5000000000000001+0.8660254037844386i)

# cbrt...
...! は Math.cbrt のエイリアス
cbrt
!(-1) # => -1.0
//}...