るりまサーチ

最速Rubyリファレンスマニュアル検索!
36件ヒット [1-36件を表示] (0.136秒)

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. kernel p
  5. dh p

ライブラリ

クラス

検索結果

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

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

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

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

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

OpenSSL::BN#coerce(other) -> Array (21132.0)

自身と other が同じクラスになるよう、自身か other を変換し [other, self] という配列にして返します。

...外 TypeError を発生させます。

//emlist[][ruby]{
require 'openssl'
p
1.to_bn.coerce(2) # => [2, 1]
//}

@param other 変換の基準となるオブジェクト
@raise TypeError 変換に失敗した場合に発生します

coerce
メソッドの詳細な説明は、Numeric#coerce にあ...
...ります。
@see Numeric#coerce...

Matrix#coerce(other) -> Array (18114.0)

他の数値オブジェクトとの変換を行います。

...トに変換し、selfとの組を配列として返します。

@param other 変換する数値オブジェクト

//emlist[例][ruby]{
require 'matrix'
a1 = [1, 2]
a2 = [-1.25, 2.2]
m = Matrix[a1, a2]
r = Rational(1, 2)
p
m.coerce(r) #=> [#<Matrix::Scalar:0x832df18 @value=(1/2)>, Matrix[[1, 2], [...