るりまサーチ

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

別のキーワード

  1. cmath log
  2. cmath log!
  3. cmath tan
  4. cmath sin
  5. cmath cos

ライブラリ

検索結果

CMath (38019.0)

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

...び出します。

//emlist[例][ruby]{
require "cmath"

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

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

include CMath

# レシーバー無しで使える
cbrt(-1) # =...