るりまサーチ

最速Rubyリファレンスマニュアル検索!
527件ヒット [1-100件を表示] (0.347秒)
トップページ > クエリ:_builtin[x] > ライブラリ:ビルトイン[x] > クエリ:E[x] > クラス:Complex[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

キーワード

検索結果

<< 1 2 3 ... > >>

Complex#coerce(other) -> [Complex, Complex] (14203.0)

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

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

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

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

Complex#angle -> Float (14103.0)

自身の偏角を[-π,π]の範囲で返します。

...囲で返します。

//emlist[例][ruby]{
Complex
.polar(3, Math::PI/2).arg # => 1.5707963267948966
//}

非正の実軸付近での挙動に注意してください。以下の例のように虚部が 0.0 と
-0.0 では値が変わります。

//emlist[例][ruby]{
Complex
(-1, 0).arg...
...3.141592653589793
Complex(-1, -0).arg #=> 3.141592653589793
Complex
(-1, -0.0).arg #=> -3.141592653589793

Complex
(0, 0.0).arg #=> 0.0
Complex
(0, -0.0).arg #=> -0.0
Complex
(-0.0, 0).arg #=> 3.141592653589793
Complex
(-0.0, -0.0).arg...
...#=> -3.141592653589793
//}


@see Numeric#arg...

Complex#between?(min, max) -> bool (14103.0)

@undef

...@undef...

Complex#conjugate -> Complex (14103.0)

自身の共役複素数を返します。

...自身の共役複素数を返します。

//emlist[例][ruby]{
Complex
(1, 2).conj # => (1-2i)
//}...

Complex#denominator -> Integer (14103.0)

分母を返します。

...と虚部の分母の最小公倍数を整数で返します。

1 2 3+4i <- numerator(分子)
- + -i -> ----
2 3 6 <- denominator(分母)

//emlist[例][ruby]{
Complex
('1/2+2/3i').denominator # => 6
Complex
(3).numerator # => 1
//}

@see Complex#numerator...

絞り込み条件を変える

Complex#finite? -> bool (14103.0)

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

...自身の絶対値が有限値の場合に true を、そうでない場合に false を返します。

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

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

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

@see Complex#infinite?...

Complex#infinite? -> nil | 1 (14103.0)

実部と虚部のどちらも無限大ではない場合に nil を、そうでない場合に 1 を返します。

...自身の絶対値が無限大の場合に1を、そうでない場合に nil を返します。

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

@see Complex#finite?...
...実部と虚部のどちらも無限大ではない場合に nil を、そうでない場合に 1 を返します。

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

@see Complex#finite?...

Complex#inspect -> String (14103.0)

自身を人間が読みやすい形の文字列表現にして返します。

...//emlist[例][ruby]{
Complex
(2).inspect # => "(2+0i)"
Complex
('-8/6').inspect # => "((-4/3)+0i)"
Complex
('1/2i').inspect # => "(0+(1/2)*i)"
Complex
(0, Float::INFINITY).inspect # => "(0+Infinity*i)"
Complex
(Float::NAN, Float::NAN).inspect...

Complex#magnitude -> Numeric (14103.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#numerator -> Complex (14103.0)

分子を返します。

...分子を返します。

//emlist[例][ruby]{
Complex
('1/2+2/3i').numerator # => (3+4i)
Complex
(3).numerator # => (3+0i)
//}

@see Complex#denominator...

絞り込み条件を変える

<< 1 2 3 ... > >>