99件ヒット
[1-99件を表示]
(0.193秒)
種類
- インスタンスメソッド (44)
- モジュール関数 (22)
- 特異メソッド (22)
- クラス (11)
モジュール
- Kernel (22)
検索結果
先頭5件
-
Complex
. rectangular(r , i = 0) -> Complex (29309.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...omplex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
//emlist[例][ruby]{
Complex.rect(1) # => (1+0i)
Complex.rect(1, 2) # => (1+2i)
Complex.rectangular(1,......2) # => (1+2i)
//}
@see Kernel.#Complex... -
Complex
# rectangular -> [Numeric , Numeric] (29303.0) -
実部と虚部を配列にして返します。
...実部と虚部を配列にして返します。
//emlist[例][ruby]{
Complex(3).rect # => [3, 0]
Complex(3.5).rect # => [3.5, 0]
Complex(3, 2).rect # => [3, 2]
//}
@see Numeric#rect... -
Numeric
# rectangular -> [Numeric , Numeric] (29303.0) -
[self, 0] を返します。
...[self, 0] を返します。
//emlist[例][ruby]{
1.rect # => [1, 0]
-1.rect # => [-1, 0]
1.0.rect # => [1.0, 0]
-1.0.rect # => [-1.0, 0]
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
@see Complex#rect... -
Kernel
. # Complex(r , i = 0 , exception: true) -> Complex | nil (14408.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...部が i である Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
@param s 生成する複素数を表す文字列。
@param exception false を指定すると、......@raise ArgumentError 変換できないオブジェクトを指定した場合に発生します。
//emlist[例][ruby]{
Complex(1) # => (1+0i)
Complex(1, 2) # => (1+2i)
Complex('1+1i') # => (1+1i)
Complex('1+1j') # => (1+1i)
# Complex.polar(10, 10) と同一。
Complex('10@10') # => (-8......mplex('_') # => ArgumentError
//}
r にも i にも複素数と解釈されるオブジェクトを指定した場合には、
Complex(a, b) を a+bi として計算した Complex オブジェクトを返しま
す。
//emlist[例][ruby]{
Complex('1+1i', '2+3i') # => (... -
Kernel
. # Complex(s , exception: true) -> Complex | nil (14408.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...部が i である Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
@param s 生成する複素数を表す文字列。
@param exception false を指定すると、......@raise ArgumentError 変換できないオブジェクトを指定した場合に発生します。
//emlist[例][ruby]{
Complex(1) # => (1+0i)
Complex(1, 2) # => (1+2i)
Complex('1+1i') # => (1+1i)
Complex('1+1j') # => (1+1i)
# Complex.polar(10, 10) と同一。
Complex('10@10') # => (-8......mplex('_') # => ArgumentError
//}
r にも i にも複素数と解釈されるオブジェクトを指定した場合には、
Complex(a, b) を a+bi として計算した Complex オブジェクトを返しま
す。
//emlist[例][ruby]{
Complex('1+1i', '2+3i') # => (... -
Kernel
. # Complex(r , i = 0) -> Complex (14308.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...虚部が i である Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
@param s 生成する複素数を表す文字列。
@raise ArgumentError 変換できないオ......します。
//emlist[例][ruby]{
Complex(1) # => (1+0i)
Complex(1, 2) # => (1+2i)
Complex('1+1i') # => (1+1i)
Complex('1+1j') # => (1+1i)
# Complex.polar(10, 10) と同一。
Complex('10@10') # => (-8.390715290764524-5.440211108893697i)
Complex('_') # => ArgumentError
//}
r にも......plex(a, b) を a+bi として計算した Complex オブジェクトを返しま
す。
//emlist[例][ruby]{
Complex('1+1i', '2+3i') # => (-2+3i)
Complex('1+1i') + Complex('2+3i') * Complex('i') # => (-2+3i)
//}
@see Complex.rect、Complex.rectangular
[注意] Complex.new... -
Kernel
. # Complex(s) -> Complex (14308.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...虚部が i である Complex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
@param s 生成する複素数を表す文字列。
@raise ArgumentError 変換できないオ......します。
//emlist[例][ruby]{
Complex(1) # => (1+0i)
Complex(1, 2) # => (1+2i)
Complex('1+1i') # => (1+1i)
Complex('1+1j') # => (1+1i)
# Complex.polar(10, 10) と同一。
Complex('10@10') # => (-8.390715290764524-5.440211108893697i)
Complex('_') # => ArgumentError
//}
r にも......plex(a, b) を a+bi として計算した Complex オブジェクトを返しま
す。
//emlist[例][ruby]{
Complex('1+1i', '2+3i') # => (-2+3i)
Complex('1+1i') + Complex('2+3i') * Complex('i') # => (-2+3i)
//}
@see Complex.rect、Complex.rectangular
[注意] Complex.new... -
Complex
. rect(r , i = 0) -> Complex (14209.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...omplex クラスのオブジェクトを生成します。
@param r 生成する複素数の実部。
@param i 生成する複素数の虚部。省略した場合は 0 です。
//emlist[例][ruby]{
Complex.rect(1) # => (1+0i)
Complex.rect(1, 2) # => (1+2i)
Complex.rectangular(1,......2) # => (1+2i)
//}
@see Kernel.#Complex... -
Complex
# rect -> [Numeric , Numeric] (14203.0) -
実部と虚部を配列にして返します。
...実部と虚部を配列にして返します。
//emlist[例][ruby]{
Complex(3).rect # => [3, 0]
Complex(3.5).rect # => [3.5, 0]
Complex(3, 2).rect # => [3, 2]
//}
@see Numeric#rect... -
Numeric
# rect -> [Numeric , Numeric] (14203.0) -
[self, 0] を返します。
...[self, 0] を返します。
//emlist[例][ruby]{
1.rect # => [1, 0]
-1.rect # => [-1, 0]
1.0.rect # => [1.0, 0]
-1.0.rect # => [-1.0, 0]
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
@see Complex#rect... -
Numeric (14026.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...値を表す抽象クラスです。Integer や Float などの数値クラス
は Numeric のサブクラスとして実装されています。
演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッド......て定義されるものがほとんどです。
つまり Numeric で定義されているメソッドは、Numeric のサブクラスとして新たに数値クラスを定義した時に、
演算メソッド(+, -, *, /, %, <=>, coerce)だけを定義すれば、数値クラスのそのほかの......しメソッド定義などではこの記法を利用します。
効率のため Numeric のメソッドと同じメソッドがサブクラスで再定義されている場合があります。
Numeric#coerce メソッドを使うことによって異なる数値クラス間で演算を行う...