180件ヒット
[101-180件を表示]
(0.361秒)
ライブラリ
- bigdecimal (168)
-
json
/ add / bigdecimal (12)
検索結果
先頭5件
-
BigDecimal
# ceil -> Integer (220.0) -
self 以上の整数のうち、最も小さい整数を計算し、その値を返します。
...の値を返します。
@param n 小数点以下の桁数を整数で指定します。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1.23456").ceil # => 2
BigDecimal("-1.23456").ceil # => -1
//}
以下のように引数を与えて、小数点以下 n+1 位の数字を操作すること......桁にします)。
n が負のときは小数点以上 n 桁目を操作します
(小数点位置から左に少なくとも n 個の 0 が並びます)。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1.23456").ceil(4).to_f # => 1.2346
BigDecimal("15.23456").ceil(-1).to_f # => 20.0
//}... -
BigDecimal
# coerce(other) -> Array (220.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
//}
other に Rational オブジェクトを指定した場合は self の有効桁数を
用......いて変換を行います。
数値を表す文字列から BigDecimal オブジェクトに変換する機能はデフォ
ルトでは無効になっています。必要な場合は ENABLE_NUMERIC_STRING を有効に
して Ruby をコンパイルしてください。... -
BigDecimal
# floor -> Integer (220.0) -
self 以下の最大整数を返します。
...整数を返します。
@param n 小数点以下の桁数を整数で指定します。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1.23456").floor # => 1
BigDecimal("-1.23456").floor # => -2
//}
以下のように引数 n を与えることもできます。
n >= 0 なら、小数点......にします)。
n が負のときは小数点以上 n 桁目を操作します
(小数点位置から左に少なくとも n 個の 0 が並びます)。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1.23456").floor(4).to_f # => 1.2345
BigDecimal("15.23456").floor(-1).to_f # => 10.0
//}... -
BigDecimal
# ==(other) -> bool (208.0) -
self が other と等しい場合に true を、そうでない場合に false を返します。
...self が other と等しい場合に true を、そうでない場合に false を返します。
それぞれの値は BigDecimal#coerce で変換して比較される場合があります。
//emlist[][ruby]{
require 'bigdecimal'
BigDecimal('1.0') == 1.0 # => true
//}... -
BigDecimal
# ===(other) -> bool (208.0) -
self が other と等しい場合に true を、そうでない場合に false を返します。
...self が other と等しい場合に true を、そうでない場合に false を返します。
それぞれの値は BigDecimal#coerce で変換して比較される場合があります。
//emlist[][ruby]{
require 'bigdecimal'
BigDecimal('1.0') == 1.0 # => true
//}... -
BigDecimal
# _ dump -> String (208.0) -
BigDecimal._load で復元可能な文字列を返します。 Marshal.#dump から呼び出されます。
...
BigDecimal._load で復元可能な文字列を返します。
Marshal.#dump から呼び出されます。
//emlist[][ruby]{
require 'bigdecimal'
inf = BigDecimal('Infinity') # => Infinity
s = Marshal.dump(inf) # => "\x04\bu:\x0FBigDecimal\x0F9:Infinity"
Marshal.load(s) # => I......nfinity
//}
@see BigDecimal._load, Marshal.#dump, Marshal.#load... -
BigDecimal
# eql?(other) -> bool (208.0) -
self が other と等しい場合に true を、そうでない場合に false を返します。
...self が other と等しい場合に true を、そうでない場合に false を返します。
それぞれの値は BigDecimal#coerce で変換して比較される場合があります。
//emlist[][ruby]{
require 'bigdecimal'
BigDecimal('1.0') == 1.0 # => true
//}...