5件ヒット
[1-5件を表示]
(0.017秒)
検索結果
先頭5件
-
Numeric
# imaginary -> 0 (126733.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
# imag -> 0 (117433.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 (114607.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
数値を表す抽象クラスです。Integer や Float などの数値クラス
は Numeric のサブクラスとして実装されています。
演算や比較を行うメソッド(+, -, *, /, <=>)は Numeric のサブクラスで定義されま
す。Numeric で定義されているメソッドは、サブクラスで提供されているメソッド
(+, -, *, /, %) を利用して定義されるものがほとんどです。
つまり Numeric で定義されているメソッドは、Numeric のサブクラスとして新たに数値クラスを定義した時に、
演算メソッド(+, -, *, /, %, <=>, coerce)だけを定義すれ... -
Complex
# imaginary -> Numeric (63967.0) -
自身の虚部を返します。
自身の虚部を返します。
//emlist[例][ruby]{
Complex(3, 2).imag # => 2
//}
@see Numeric#imag -
Complex
# imag -> Numeric (54667.0) -
自身の虚部を返します。
自身の虚部を返します。
//emlist[例][ruby]{
Complex(3, 2).imag # => 2
//}
@see Numeric#imag