6件ヒット
[1-6件を表示]
(0.073秒)
検索結果
先頭1件
-
CMath (15.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) # => (0.5000000000000001+0.8660254037844386i)
# cbrt! は Math.cbrt のエイリアス
cbrt!(-1) # => -1.0
//}...