121件ヒット
[1-100件を表示]
(0.121秒)
種類
- インスタンスメソッド (66)
- モジュール関数 (22)
- 特異メソッド (22)
- クラス (11)
モジュール
- Kernel (22)
検索結果
先頭5件
-
Complex
. rectangular(r , i = 0) -> Complex (21331.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...実部が 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... -
Numeric
# rectangular -> [Numeric , Numeric] (21313.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
# rectangular -> [Numeric , Numeric] (21301.0) -
実部と虚部を配列にして返します。
...実部と虚部を配列にして返します。
//emlist[例][ruby]{
Complex(3).rect # => [3, 0]
Complex(3.5).rect # => [3.5, 0]
Complex(3, 2).rect # => [3, 2]
//}
@see Numeric#rect... -
Matrix
# rectangular -> [Matrix , Matrix] (21301.0) -
行列を実部と虚部に分解したものを返します。
...行列を実部と虚部に分解したものを返します。
//emlist[例][ruby]{
m.rect == [m.real, m.imag] # ==> true for all matrices m
//}
@see Matrix#imaginary, Matrix#real... -
Numeric (8190.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...を表す抽象クラスです。Integer や Float などの数値クラス
は Numeric のサブクラスとして実装されています。
演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッドは......るメソッド
(+, -, *, /, %) を利用して定義されるものがほとんどです。
つまり Numeric で定義されているメソッドは、Numeric のサブクラスとして新たに数値クラスを定義した時に、
演算メソッド(+, -, *, /, %, <=>, coerce)だけを定義......| o - - - - - o
real? | o - - - - - o
rect | o - - - - - o
rectangular |......- - o
rect | o - - - o
Numeric Integer Float Rational Complex
--------------------------------------------------------------------------------
rectangular |... -
Complex
. rect(r , i = 0) -> Complex (6231.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...実部が 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... -
Numeric
# rect -> [Numeric , Numeric] (6213.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 -> [Numeric , Numeric] (6201.0) -
実部と虚部を配列にして返します。
...実部と虚部を配列にして返します。
//emlist[例][ruby]{
Complex(3).rect # => [3, 0]
Complex(3.5).rect # => [3.5, 0]
Complex(3, 2).rect # => [3, 2]
//}
@see Numeric#rect... -
Matrix
# rect -> [Matrix , Matrix] (6201.0) -
行列を実部と虚部に分解したものを返します。
...行列を実部と虚部に分解したものを返します。
//emlist[例][ruby]{
m.rect == [m.real, m.imag] # ==> true for all matrices m
//}
@see Matrix#imaginary, Matrix#real... -
Kernel
. # Complex(r , i = 0) -> Complex (3241.0) -
実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
...実部が r、虚部が 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 にも 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 系では廃止...