77件ヒット
[1-77件を表示]
(0.106秒)
ライブラリ
- ビルトイン (22)
- bigdecimal (44)
- openssl (11)
クラス
- BigDecimal (44)
- Complex (11)
-
OpenSSL
:: BN (11) - Rational (11)
検索結果
先頭5件
-
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 (21126.0) -
自身と other が同じクラスになるよう、自身か other を変換し [other, self] という配列にして返します。
...[other, self] という配列にして返します。
基本的に other が整数のときに、自身を Integer のオブジェクトに
変換して [other, 変換後オブジェクト] にして返します。
それ以外の場合は例外 TypeError を発生させます。
//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 (21114.0) -
self と other が同じクラスになるよう、self か other を変換し [other, self] という配列にして返します。
...self と other が同じクラスになるよう、self か other を変換し [other,
self] という配列にして返します。
@param other 比較または変換するオブジェクト
BigDecimal#coerce は Ruby における強制型変換のための機能です。
BigDecimal オブジェ......al#coerce の結果を元に行われます。
//emlist[][ruby]{
require "bigdecimal"
a = BigDecimal("1.0")
b = a / 2.0 # => 0.5e0
//}
other に Rational オブジェクトを指定した場合は self の有効桁数を
用いて変換を行います。
数値を表す文字列から BigDecimal......オブジェクトに変換する機能はデフォ
ルトでは無効になっています。必要な場合は ENABLE_NUMERIC_STRING を有効に
して Ruby をコンパイルしてください。... -
Rational
# coerce(other) -> Array (21114.0) -
自身と other が同じクラスになるよう、自身か other を変換し [other, self] という 配列にして返します。
...other が同じクラスになるよう、自身か other を変換し [other, self] という
配列にして返します。
@param other 比較または変換するオブジェクト
//emlist[例][ruby]{
Rational(1).coerce(2) # => [(2/1), (1/1)]
Rational(1).coerce(2.2) # => [2.2, 1.0]
//}... -
BigDecimal
# eql?(other) -> bool (6107.0) -
self が other と等しい場合に true を、そうでない場合に false を返します。
...self が other と等しい場合に true を、そうでない場合に false を返します。
それぞれの値は BigDecimal#coerce で変換して比較される場合があります。
//emlist[][ruby]{
require 'bigdecimal'
BigDecimal('1.0') == 1.0 # => true
//}... -
BigDecimal
# ==(other) -> bool (3107.0) -
self が other と等しい場合に true を、そうでない場合に false を返します。
...self が other と等しい場合に true を、そうでない場合に false を返します。
それぞれの値は BigDecimal#coerce で変換して比較される場合があります。
//emlist[][ruby]{
require 'bigdecimal'
BigDecimal('1.0') == 1.0 # => true
//}... -
BigDecimal
# ===(other) -> bool (3107.0) -
self が other と等しい場合に true を、そうでない場合に false を返します。
...self が other と等しい場合に true を、そうでない場合に false を返します。
それぞれの値は BigDecimal#coerce で変換して比較される場合があります。
//emlist[][ruby]{
require 'bigdecimal'
BigDecimal('1.0') == 1.0 # => true
//}...