るりまサーチ

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

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

ライブラリ

検索結果

Numeric#to_c -> Complex (18259.0)

自身を複素数 (Complex) に変換します。Complex(self, 0) を返します。

...自身を複素数 (Complex) に変換します。Complex(self, 0) を返します。

//emlist[例][ruby]{
1.to_c # => (1+0i)
-1.to_c # => (-1+0i)
1.0.to_c # => (1.0+0i)
Rational(1, 2).to_c # => ((1/2)+0i)
//}

Numeric
のサブクラスは、このメソッド...