るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.014秒)
トップページ > クエリ:numeric[x] > クエリ:Complex[x] > クラス:Matrix[x]

別のキーワード

  1. numeric step
  2. _builtin numeric
  3. numeric polar
  4. numeric modulo
  5. numeric coerce

ライブラリ

検索結果

Matrix#real? -> bool (41.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
//}...