44件ヒット
[1-44件を表示]
(0.016秒)
トップページ > :Complex#real?
別のキーワード
種類
- インスタンスメソッド (33)
- クラス (11)
検索結果
-
Complex
# real? -> false (62113.0) -
常に false を返します。
...常に false を返します。
//emlist[例][ruby]{
(2+3i).real? # => false
(2+0i).real? # => false
//}
@see Numeric#real?... -
Numeric
# real? -> bool (18147.0) -
常に true を返します。(Complex またはそのサブクラスではないことを意味します。)
...す。(Complex またはそのサブクラスではないことを意味します。)
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
//emlist[例][ruby]{
10.real? # => true
-10.real? # => true
0.1.real?......# => true
Rational(2, 3).real? # => true
//}
@see Numeric#integer?、Complex#real?... -
Matrix
# real? -> bool (18143.0) -
行列の全要素が実(Numeric#real?)であれば true を返します。
...全要素が実(Numeric#real?)であれば true を返します。
Complexオブジェクトを要素に持つ場合は虚部が0でも偽を返します。
//emlist[例][ruby]{
require 'matrix'
Matrix[[1, 0], [0, 1]].real? # => true
Matrix[[Complex(0, 1), 0], [0, 1]].real? # => false
# 要素が......実数であっても Complex オブジェクトなら偽を返す。
Matrix[[Complex(1, 0), 0], [0, 1]].real? # => false
//}... -
Numeric (60.0)
-
数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。
...by 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
Numeric Integer Fixnum Bignum Float Rational Complex
-------------------------------------------------------------------------------------------
% | o......o o o - -
Numeric Integer Fixnum Bignum Float Rational Complex
-------------------------------------------------------------------------------------------
<< | -......o o - - -
Numeric Integer Fixnum Bignum Float Rational Complex
-------------------------------------------------------------------------------------------
abs | o......い。
=> ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin15]
Numeric Integer Float Rational Complex
--------------------------------------------------------------------------------
% | o o o......< | - o o - -
Numeric Integer Float Rational Complex
--------------------------------------------------------------------------------
<< | - o -......^ | - o - - -
Numeric Integer Float Rational Complex
--------------------------------------------------------------------------------
abs | o o o...