るりまサーチ (Ruby 2.4.0)

最速Rubyリファレンスマニュアル検索!
5件ヒット [1-5件を表示] (0.340秒)

別のキーワード

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

クラス

キーワード

検索結果

Complex#imaginary -> Numeric (69310.0)

自身の虚部を返します。

自身の虚部を返します。

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

@see Numeric#imag

Numeric#imaginary -> 0 (69310.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

Numeric (24025.0)

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

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

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

Complex#imag -> Numeric (24010.0)

自身の虚部を返します。

自身の虚部を返します。

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

@see Numeric#imag

Numeric#imag -> 0 (24010.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

絞り込み条件を変える