7件ヒット
[1-7件を表示]
(0.102秒)
別のキーワード
ライブラリ
- bigdecimal (6)
-
json
/ add / bigdecimal (1)
検索結果
先頭5件
-
BigDecimal
# *(other) -> BigDecimal (54307.0) -
積を計算します。
...積を計算します。
@param other self に掛ける数を指定します。
計算結果の精度についてはlib:bigdecimal#precisionを参照してください。... -
BigDecimal
# **(n) -> BigDecimal (18307.0) -
self の n 乗を計算します。
self の n 乗を計算します。
戻り値の有効桁数は self の有効桁数の n 倍以上になります。
@param n selfを other 乗する数を指定します。
@param prec 有効桁数を整数で指定します。
@see Integer#pow -
BigDecimal
# power(n) -> BigDecimal (9007.0) -
self の n 乗を計算します。
self の n 乗を計算します。
戻り値の有効桁数は self の有効桁数の n 倍以上になります。
@param n selfを other 乗する数を指定します。
@param prec 有効桁数を整数で指定します。
@see Integer#pow -
BigDecimal
# power(n , prec) -> BigDecimal (9007.0) -
self の n 乗を計算します。
self の n 乗を計算します。
戻り値の有効桁数は self の有効桁数の n 倍以上になります。
@param n selfを other 乗する数を指定します。
@param prec 有効桁数を整数で指定します。
@see Integer#pow -
BigDecimal
# to _ json(*args) -> String (307.0) -
自身を JSON 形式の文字列に変換して返します。
..._json を呼び出しています。
@param args 使用しません。
//emlist[例][ruby]{
require 'json/add/bigdecimal'
BigDecimal('0.123456789123456789').to_json # => "{\"json_class\":\"BigDecimal\",\"b\":\"36:0.123456789123456789e0\"}"
//}
@see JSON::Generator::GeneratorMethods::Hash#to_json... -
BigDecimal
# split -> [Integer , String , Integer , Integer] (55.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
# mult(other , n) -> BigDecimal (25.0) -
積を計算します。
...の精度が n より大きい
ときは BigDecimal.mode で指定された方法で丸められます。
@param other self に掛ける数を指定します。
@param n 有効桁数を整数で指定します。0 を指定した場合は
BigDecimal#* と同じ値を返します。
@rais......e ArgumentError n に負の数を指定した場合に発生します。
@see BigDecimal#*...