るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
7件ヒット [1-7件を表示] (0.024秒)
トップページ > バージョン:2.6.0[x] > クエリ:Complex[x] > クエリ:imag[x] > クエリ:imaginary[x]

別のキーワード

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

ライブラリ

クラス

検索結果

Complex#imaginary -> Numeric (126661.0)

自身の虚部を返します。

自身の虚部を返します。

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

@see Numeric#imag

Complex#imag -> Numeric (117361.0)

自身の虚部を返します。

自身の虚部を返します。

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

@see Numeric#imag

Numeric#imaginary -> 0 (63715.0)

常に 0 を返します。

常に 0 を返します。

//emlist[例][ruby]{
12.imag # => 0
-12.imag # => 0
1.2.imag # => 0
-1.2.imag # => 0
//}

Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。

@see Numeric#real、Complex#imag

Matrix#imaginary -> Matrix (63697.0)

行列の虚部を返します。

行列の虚部を返します。

//emlist[例][ruby]{
require 'matrix'
Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]]
# => 1+2i i 0
# 1 2 3
Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]].imaginary
# => 2i i 0
# 0 0 0
//}

Numeric#imag -> 0 (54415.0)

常に 0 を返します。

常に 0 を返します。

//emlist[例][ruby]{
12.imag # => 0
-12.imag # => 0
1.2.imag # => 0
-1.2.imag # => 0
//}

Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。

@see Numeric#real、Complex#imag

絞り込み条件を変える

Matrix#imag -> Matrix (54397.0)

行列の虚部を返します。

行列の虚部を返します。

//emlist[例][ruby]{
require 'matrix'
Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]]
# => 1+2i i 0
# 1 2 3
Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]].imaginary
# => 2i i 0
# 0 0 0
//}

Numeric (199.0)

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

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

演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッドは、サブクラスで提供されているメソッド
(+, -, *, /, %) を利用して定義されるものがほとんどです。
つまり Numeric で定義されているメソッドは、Numeric のサブクラスとして新たに数値クラスを定義した時に、
演算メソッド(+, -, *, /, %, <=>, coerce)だけを定義すれ...