るりまサーチ (Ruby 2.3.0)

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

別のキーワード

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

ライブラリ

検索結果

Complex#coerce(other) -> [Complex, Complex] (78325.0)

other を Complex に変換して [変換後の other, self] の配列を返します。

...other を Complex に変換して [変換後の other, self] の配列を返します。

@raise TypeError 変換できないオブジェクトを指定した場合に発生します。

//emlist[例][ruby]{
Complex
(1).coerce(2) # => [(2+0i), (1+0i)]
//}...