るりまサーチ (Ruby 2.2.0)

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

別のキーワード

  1. _builtin float
  2. float to_d
  3. json float
  4. float rationalize
  5. fiddle type_float

ライブラリ

検索結果

Complex#abs -> Numeric (54397.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#magnitude -> Numeric (9097.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...