るりまサーチ

最速Rubyリファレンスマニュアル検索!
55件ヒット [1-55件を表示] (0.014秒)
トップページ > クエリ:Complex[x] > クエリ:real[x] > クラス:Complex[x]

別のキーワード

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

ライブラリ

キーワード

検索結果

Complex#real -> Numeric (39114.0)

自身の実部を返します。

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

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

Complex#real? -> false (27120.0)

常に false を返します。

...常に false を返します。

//emlist[例][ruby]{
(2+3i).real? # => false
(2+0i).real? # => false
//}

@see Numeric#real?...

Complex#abs -> Numeric (21031.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#abs2 -> Numeric (21031.0)

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

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

以下の計算の結果を返します。

self.real ** 2 + self.imag ** 2

//emlist[例][ruby]{
Complex
(1, 1).abs2 # => 2
Complex
(1.0, 1.0).abs2 # => 2.0
Complex
('1/2', '1/2').abs2 # => (1/2)
//}

@see Complex#abs...

Complex#magnitude -> Numeric (21031.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...

絞り込み条件を変える