99件ヒット
[1-99件を表示]
(0.283秒)
種類
- インスタンスメソッド (44)
- モジュール関数 (22)
- 特異メソッド (22)
- クラス (11)
モジュール
- Kernel (22)
検索結果
先頭5件
-
Complex
. rectangular(r , i = 0) -> Complex (23109.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...成します。
@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] (23103.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] (23103.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 -
Complex
. rect(r , i = 0) -> Complex (8009.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...成します。
@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... -
Kernel
. # Complex(r , i = 0) -> Complex (8008.0) -
実部が r、虚部が i である 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.new! は 1.9 系では廃止されました。... -
Kernel
. # Complex(r , i = 0 , exception: true) -> Complex | nil (8008.0) -
実部が r、虚部が i である 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.new! は 1.9 系では廃止されました。... -
Kernel
. # Complex(s) -> Complex (8008.0) -
実部が r、虚部が i である 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.new! は 1.9 系では廃止されました。... -
Kernel
. # Complex(s , exception: true) -> Complex | nil (8008.0) -
実部が r、虚部が i である 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.new! は 1.9 系では廃止されました。... -
Numeric (8008.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...- - - o
rect | o - - - - - o
rectangular | o - - - - - o
remainder | o - -......Numeric Integer Float Rational Complex
--------------------------------------------------------------------------------
rectangular | o - - - o
remainder | o o - - -... -
Complex
# rect -> [Numeric , Numeric] (8003.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] (8003.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