D 2.0
About Japanese Translation

www.digitalmars.com
Last update Sun May 2 23:21:14 2010

std.complex

組み込みの cfloat, cdouble, creal, ifloat, idouble, ireal を置き換えるモジュール

Authors:
Lars Tandle Kyllingstad

License:
Boost License 1.0

struct Complex(T) if (isFloatingPoint!(T));
実数型 T をベースにした複素数型

BUGS:
opAssign や opOpAssign などの演算子は参照返しをするべきですが、 現在はそうなっていません。これは、 DMD bug 2460 が修正されればただちに実装される予定です。

T re;
実部

T im;
虚部

const T abs();
絶対値を計算

const T arg();
偏角を計算

const Complex conj();
共役複素数を計算

template toString(Writer,String)(ref Writer writer, String formatSpec) const if (isOutputRange!(Writer,String))
複素数を文字列に変換し、 出力レンジ writer に書き込みます。

出力形式は formatSpec に POSIXの書式指定を % なしで一つ指定することで定めます。 複素数は浮動小数点数なので、 'e', 'f', 'g', 'a', と 's' のみが使用できます。 's' を指定するとデフォルトの動作となります。位置指定パラメタは使用できません。

さらに詳細な情報は std.format のドキュメント にあります。

Complex!(CommonType!(T,U)) fromPolar(T, U)(T modulus, U argument);
絶対値と偏角から複素数を求めます。