ライブラリ
- bigdecimal (504)
-
bigdecimal
/ util (24) -
json
/ add / bigdecimal (12)
キーワード
- * (12)
- + (12)
- - (12)
-
/ (12) - < (12)
- <= (12)
- <=> (12)
- == (12)
- === (12)
- > (12)
- >= (12)
-
_ dump (12) - add (12)
- ceil (12)
- coerce (12)
- div (24)
- eql? (12)
- exponent (12)
- finite? (12)
- floor (12)
- hash (12)
- infinite? (12)
- inspect (12)
- mult (12)
- precs (12)
- quo (12)
- round (12)
-
save
_ exception _ mode (12) -
save
_ limit (12) -
save
_ rounding _ mode (12) - split (12)
- sqrt (12)
- sub (12)
-
to
_ d (12) -
to
_ digits (12) -
to
_ f (12) -
to
_ i (12) -
to
_ int (12) -
to
_ json (12) -
to
_ r (12) -
to
_ s (24) - truncate (24)
検索結果
先頭5件
-
BigDecimal
# save _ limit { . . . } -> object (6202.0) -
現在の BigDecimal.limit の設定を保存してブロックを評価します。ブ ロック中で変更した設定はブロックの評価後に復元されます。
...現在の BigDecimal.limit の設定を保存してブロックを評価します。ブ
ロック中で変更した設定はブロックの評価後に復元されます。
ブロックの評価結果を返します。... -
BigDecimal
# exponent -> Integer (6102.0) -
self の指数部を整数値で返します。
self の指数部を整数値で返します。 -
BigDecimal
# finite? -> bool (6102.0) -
self が ∞または NaN でないときに true を返します。それ以外のときに false を返します。
...self が ∞または NaN でないときに true を返します。それ以外のときに
false を返します。... -
BigDecimal
# infinite? -> 1 | -1 | nil (6102.0) -
self が +∞のときに 1 、-∞のときに-1、それ以外のときに nil を返します。
self が +∞のときに 1 、-∞のときに-1、それ以外のときに nil を返します。 -
BigDecimal
# inspect -> String (6102.0) -
BigDecimal オブジェクトを表す文字列を返します。
...
BigDecimal オブジェクトを表す文字列を返します。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1234.5678").inspect
# => "0.12345678e4"
//}... -
BigDecimal
# mult(other , n) -> BigDecimal (6102.0) -
積を計算します。
...積を計算します。
self * other を最大で n 桁まで計算します。計算結果の精度が n より大きい
ときは BigDecimal.mode で指定された方法で丸められます。
@param other self に掛ける数を指定します。
@param n 有効桁数を整数で指定し......ます。0 を指定した場合は
BigDecimal#* と同じ値を返します。
@raise ArgumentError n に負の数を指定した場合に発生します。
@see BigDecimal#*... -
BigDecimal
# save _ exception _ mode { . . . } -> object (6102.0) -
例外処理に関する BigDecimal.mode の設定を保存してブロックを評価し ます。ブロック中で変更した設定はブロックの評価後に復元されます。
...例外処理に関する BigDecimal.mode の設定を保存してブロックを評価し
ます。ブロック中で変更した設定はブロックの評価後に復元されます。
ブロックの評価結果を返します。... -
BigDecimal
# split -> [Integer , String , Integer , Integer] (6102.0) -
BigDecimal 値を 0.xxxxxxx*10**n と表現したときに、 符号 (NaNのときは 0、それ以外は+1か-1になります)、 仮数部分の文字列("xxxxxxx")と、基数(10)、更に指数 n を配列で返します。
...
BigDecimal 値を 0.xxxxxxx*10**n と表現したときに、
符号 (NaNのときは 0、それ以外は+1か-1になります)、
仮数部分の文字列("xxxxxxx")と、基数(10)、更に指数 n を配列で返します。
//emlist[][ruby]{
require "bigdecimal"
a = BigDecimal("3.14159265")
f......, x, y, z = a.split
//}
とすると、f = 1、x = "314159265"、y = 10、z = 1 になります。
従って、以下のようにする事で Float に変換することができます。
//emlist[][ruby]{
s = "0."+x
b = f*(s.to_f)*(y**z)
//}
@see BigDecimal#to_f... -
BigDecimal
# sqrt(n) -> BigDecimal (6102.0) -
self の有効桁 n 桁の平方根 (n の平方根ではありません) をニュートン法で 計算します。
...self の有効桁 n 桁の平方根 (n の平方根ではありません) をニュートン法で
計算します。
@param n 有効桁数を整数で指定します。
@raise ArgumentError n に負の数を指定した場合に発生します。...