84件ヒット
[1-84件を表示]
(0.078秒)
別のキーワード
ライブラリ
- bigdecimal (48)
- matrix (12)
- openssl (12)
- uri (12)
クラス
- BigDecimal (48)
- Matrix (12)
-
OpenSSL
:: BN (12) -
URI
:: Generic (12)
検索結果
先頭5件
-
OpenSSL
:: BN # coerce(other) -> Array (18132.0) -
自身と other が同じクラスになるよう、自身か other を変換し [other, self] という配列にして返します。
...。
//emlist[][ruby]{
require 'openssl'
p 1.to_bn.coerce(2) # => [2, 1]
//}
@param other 変換の基準となるオブジェクト
@raise TypeError 変換に失敗した場合に発生します
coerce メソッドの詳細な説明は、Numeric#coerce にあります。
@see Numeric#coerce... -
BigDecimal
# coerce(other) -> Array (18120.0) -
self と other が同じクラスになるよう、self か other を変換し [other, self] という配列にして返します。
...オブジェクト
BigDecimal#coerce は Ruby における強制型変換のための機能です。
BigDecimal オブジェクトとその他のオブジェクト間の各種の計算は
BigDecimal#coerce の結果を元に行われます。
//emlist[][ruby]{
require "bigdecimal"
a = BigDecimal("... -
Matrix
# coerce(other) -> Array (18114.0) -
他の数値オブジェクトとの変換を行います。
...との組を配列として返します。
@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], [-1.25, 2.2]]]
//}... -
URI
:: Generic # coerce(oth) -> [URI , URI] (18114.0) -
引数 oth をパースして [パース後の oth, self] の配列を返します。
...oth, self] の配列を返します。
@param oth URI オブジェクトか文字列を指定します。
例:
require 'uri'
uri = URI.parse("http://my.example.com")
uri.coerce("http://foo.com")
# => [#<URI::HTTP:0x00000000bcb028 URL:http://foo.com/>, #<URI::HTTP:0x00000000d92178 URL:ht... -
BigDecimal
# ==(other) -> bool (13.0) -
self が other と等しい場合に true を、そうでない場合に false を返します。
...self が other と等しい場合に true を、そうでない場合に false を返します。
それぞれの値は BigDecimal#coerce で変換して比較される場合があります。
//emlist[][ruby]{
require 'bigdecimal'
BigDecimal('1.0') == 1.0 # => true
//}... -
BigDecimal
# ===(other) -> bool (13.0) -
self が other と等しい場合に true を、そうでない場合に false を返します。
...self が other と等しい場合に true を、そうでない場合に false を返します。
それぞれの値は BigDecimal#coerce で変換して比較される場合があります。
//emlist[][ruby]{
require 'bigdecimal'
BigDecimal('1.0') == 1.0 # => true
//}... -
BigDecimal
# eql?(other) -> bool (13.0) -
self が other と等しい場合に true を、そうでない場合に false を返します。
...self が other と等しい場合に true を、そうでない場合に false を返します。
それぞれの値は BigDecimal#coerce で変換して比較される場合があります。
//emlist[][ruby]{
require 'bigdecimal'
BigDecimal('1.0') == 1.0 # => true
//}...