るりまサーチ

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

別のキーワード

  1. _builtin abs
  2. _builtin abs2
  3. bigdecimal abs
  4. float abs
  5. integer abs

ライブラリ

クラス

キーワード

検索結果

Numeric (38148.0)

数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。

...スです。Integer や Float などの数値クラス
Numeric のサブクラスとして実装されています。

演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッドは、サブクラスで...
...----------------------------------------
abs | o - o o o - o
abs2
| o - - - - - o
angle | o - -...
...i | o - - - - - -
imag
| o - - - - - o
imag
inary | o - - - - - o...
...- -
Numeric
Integer Float Rational Complex
--------------------------------------------------------------------------------
abs | o o o o o
abs2
| o...
...o o o
i | o - - - -
imag
| o - - - o
imag
inary | o - - - o
infinite? | o...

Complex#abs2 -> Numeric (18226.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#abs -> Numeric (114.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 (114.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...