るりまサーチ

最速Rubyリファレンスマニュアル検索!
1059件ヒット [101-200件を表示] (0.056秒)

別のキーワード

  1. _builtin complex
  2. complex rect
  3. complex polar
  4. kernel complex
  5. complex rationalize

ライブラリ

クラス

モジュール

キーワード

検索結果

<< < 1 2 3 4 ... > >>

Complex#finite? -> bool (27118.0)

実部と虚部の両方が有限値の場合に true を、そうでない場合に false を返します。

...実部と虚部の両方が有限値の場合に true を、そうでない場合に false を返します。

//emlist[例][ruby]{
(1 + 1i).finite? # => true
(Float::INFINITY + 1i).finite? # => false
//}

@see Complex#infinite?...

Complex#imag -> Numeric (27106.0)

自身の虚部を返します。

...自身の虚部を返します。

//emlist[例][ruby]{
Complex
(3, 2).imag # => 2
//}

@see Numeric#imag...

Complex#imaginary -> Numeric (27106.0)

自身の虚部を返します。

...自身の虚部を返します。

//emlist[例][ruby]{
Complex
(3, 2).imag # => 2
//}

@see Numeric#imag...

Complex#magnitude -> Numeric (24124.0)

自身の絶対値を返します。

...す。

以下の計算の結果を Float オブジェクトで返します。

sqrt(self.real ** 2 + self.imag ** 2)

//emlist[例][ruby]{
Complex
(1, 2).abs # => 2.23606797749979
Complex
(3, 4).abs # => 5.0
Complex
('1/2', '1/2').abs # => 0.7071067811865476
//}

@see Complex#abs2...

Complex#to_r -> Rational (24112.0)

自身を Rational に変換します。

...自身を Rational に変換します。

@param eps 許容する誤差。常に無視されます。

@raise RangeError 虚部が実数か、0 ではない場合に発生します。

//emlist[例][ruby]{
Complex
(3).to_r # => (3/1)
Complex
(3, 2).to_r # => RangeError
//}...

絞り込み条件を変える

Complex.rect(r, i = 0) -> Complex (21284.0)

実部が r、虚部が i である Complex クラスのオブジェクトを生成します。

... 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(r, i = 0) -> Complex (21284.0)

実部が r、虚部が i である Complex クラスのオブジェクトを生成します。

... 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#coerce(other) -> [Complex, Complex] (21236.0)

other を Complex に変換して [変換後の other, self] の配列を返します。

...other を Complex に変換して [変換後の other, self] の配列を返します。

@raise TypeError 変換できないオブジェクトを指定した場合に発生します。

//emlist[例][ruby]{
Complex
(1).coerce(2) # => [(2+0i), (1+0i)]
//}...

Complex#rect -> [Numeric, Numeric] (21218.0)

実部と虚部を配列にして返します。

...実部と虚部を配列にして返します。

//emlist[例][ruby]{
Complex
(3).rect # => [3, 0]
Complex
(3.5).rect # => [3.5, 0]
Complex
(3, 2).rect # => [3, 2]
//}

@see Numeric#rect...

Complex#rectangular -> [Numeric, Numeric] (21218.0)

実部と虚部を配列にして返します。

...実部と虚部を配列にして返します。

//emlist[例][ruby]{
Complex
(3).rect # => [3, 0]
Complex
(3.5).rect # => [3.5, 0]
Complex
(3, 2).rect # => [3, 2]
//}

@see Numeric#rect...

絞り込み条件を変える

<< < 1 2 3 4 ... > >>