4件ヒット
[1-4件を表示]
(0.107秒)
検索結果
先頭4件
-
BigDecimal
# coerce(other) -> Array (105451.0) -
self と other が同じクラスになるよう、self か other を変換し [other, self] という配列にして返します。
self と other が同じクラスになるよう、self か other を変換し [other,
self] という配列にして返します。
@param other 比較または変換するオブジェクト
BigDecimal#coerce は Ruby における強制型変換のための機能です。
BigDecimal オブジェクトとその他のオブジェクト間の各種の計算は
BigDecimal#coerce の結果を元に行われます。
//emlist[][ruby]{
require "bigdecimal"
a = BigDecimal("1.0")
b = a / 2.0 # => 0.5e0
... -
BigDecimal
# ==(other) -> bool (51076.0) -
self が other と等しい場合に true を、そうでない場合に false を返します。
self が other と等しい場合に true を、そうでない場合に false を返します。
それぞれの値は BigDecimal#coerce で変換して比較される場合があります。
//emlist[][ruby]{
require 'bigdecimal'
BigDecimal('1.0') == 1.0 # => true
//} -
BigDecimal
# ===(other) -> bool (51076.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 (51076.0) -
self が other と等しい場合に true を、そうでない場合に false を返します。
self が other と等しい場合に true を、そうでない場合に false を返します。
それぞれの値は BigDecimal#coerce で変換して比較される場合があります。
//emlist[][ruby]{
require 'bigdecimal'
BigDecimal('1.0') == 1.0 # => true
//}