13件ヒット
[1-13件を表示]
(0.029秒)
種類
- インスタンスメソッド (7)
- 定数 (3)
- 特異メソッド (2)
- ライブラリ (1)
ライブラリ
- ビルトイン (3)
- bigdecimal (7)
-
bigdecimal
/ util (2)
クラス
- BigDecimal (7)
- Float (2)
- Integer (3)
キーワード
- ** (1)
-
EXCEPTION
_ ALL (1) -
EXCEPTION
_ INFINITY (1) -
_ dump (1) - bigdecimal (1)
- mode (2)
- pow (2)
- sign (1)
-
to
_ d (2)
検索結果
先頭5件
-
BigDecimal
:: INFINITY -> BigDecimal (117655.0) -
正の無限大を表す BigDecimal オブジェクトを返します。
正の無限大を表す BigDecimal オブジェクトを返します。 -
BigDecimal
:: EXCEPTION _ INFINITY -> Integer (81370.0) -
BigDecimal の計算結果が無限大になった場合に例外を発生させるかどう かを設定、確認する際の値を返します。
BigDecimal の計算結果が無限大になった場合に例外を発生させるかどう
かを設定、確認する際の値を返します。
BigDecimal.mode の第 1 引数に指定します。 -
BigDecimal
. mode(s) -> Integer | nil (64057.0) -
BigDecimal の計算処理の制御方法を設定、確認します。
BigDecimal の計算処理の制御方法を設定、確認します。
第2引数を省略、または nil を指定すると現状の設定値を返します。
@param s 制御方法の設定、確認を行う項目を BigDecimal::EXCEPTION_*、
BigDecimal::ROUND_MODE のいずれかで指定します。
@param v 引数 s が BigDecimal::ROUND_MODE の場合は
BigDecimal::ROUND_MODE 以外の BigDecimal::_ROUND* のいず
れかを指定します。指定した丸め処理が有効... -
BigDecimal
. mode(s , v) -> Integer | nil (64057.0) -
BigDecimal の計算処理の制御方法を設定、確認します。
BigDecimal の計算処理の制御方法を設定、確認します。
第2引数を省略、または nil を指定すると現状の設定値を返します。
@param s 制御方法の設定、確認を行う項目を BigDecimal::EXCEPTION_*、
BigDecimal::ROUND_MODE のいずれかで指定します。
@param v 引数 s が BigDecimal::ROUND_MODE の場合は
BigDecimal::ROUND_MODE 以外の BigDecimal::_ROUND* のいず
れかを指定します。指定した丸め処理が有効... -
BigDecimal
# sign -> -3 | -2 | -1 | 0 | 1 | 2 | 3 (63415.0) -
自身の符号等の性質に応じて、Integer を返します。
自身の符号等の性質に応じて、Integer を返します。
符号が正であれば正の整数を返し、負であれば負の整数を返し、NaN であれば 0 を返します。
NaN であれば、 0。 BigDecimal::SIGN_NaN と同じです。
+0 であれば、 1。 BigDecimal::SIGN_POSITIVE_ZERO と同じです。
-0 であれば、-1。 BigDecimal::SIGN_NEGATIVE_ZERO と同じです。
有限の正の値 であれば、 2。 BigDecimal::SIGN_POSITIVE_FINITE ... -
BigDecimal
# _ dump -> String (63175.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) # => Infinity
//}
@see BigDecimal._load, Marshal.#dump,... -
BigDecimal
:: EXCEPTION _ ALL -> Integer (63175.0) -
BigDecimal の計算において例外を発生させるかどうかを設定、確認する 際の値を返します。
BigDecimal の計算において例外を発生させるかどうかを設定、確認する
際の値を返します。
以下の例外全てが対象です。
* BigDecimal::EXCEPTION_INFINITY
* BigDecimal::EXCEPTION_NaN
* BigDecimal::EXCEPTION_OVERFLOW
* BigDecimal::EXCEPTION_UNDERFLOW
* BigDecimal::EXCEPTION_ZERODIVIDE
BigDecimal.mode の第 1 引数に指定します。 -
bigdecimal (20119.0)
-
bigdecimal は浮動小数点数演算ライブラリです。 任意の精度で 10 進表現された浮動小数点数を扱えます。
bigdecimal は浮動小数点数演算ライブラリです。
任意の精度で 10 進表現された浮動小数点数を扱えます。
//emlist[][ruby]{
require 'bigdecimal'
a = BigDecimal("0.123456789123456789")
b = BigDecimal("123456.78912345678", 40)
print a + b # => 0.123456912580245903456789e6
//}
一般的な 10 進数の計算でも有用です。2 進数の浮動小数点演算には微小な誤
差があるのに対し、BigDecimal では正確な値を得る事がで... -
Float
# to _ d -> BigDecimal (427.0) -
自身を BigDecimal に変換します。
自身を BigDecimal に変換します。
@param prec 計算結果の精度。省略した場合は Float::DIG + 1 です。
@return BigDecimal に変換したオブジェクト
//emlist[][ruby]{
require 'bigdecimal'
require 'bigdecimal/util'
p 1.0.to_d # => 0.1e1
p (1.0 / 0).to_d # => Infinity
p (1.0 / 3).to_d / (2.0 / 3).to_d # => 0.5e0
p ((1.0 / 3) / (2.0 / 3... -
Float
# to _ d(prec) -> BigDecimal (427.0) -
自身を BigDecimal に変換します。
自身を BigDecimal に変換します。
@param prec 計算結果の精度。省略した場合は Float::DIG + 1 です。
@return BigDecimal に変換したオブジェクト
//emlist[][ruby]{
require 'bigdecimal'
require 'bigdecimal/util'
p 1.0.to_d # => 0.1e1
p (1.0 / 0).to_d # => Infinity
p (1.0 / 3).to_d / (2.0 / 3).to_d # => 0.5e0
p ((1.0 / 3) / (2.0 / 3... -
Integer
# **(other) -> Numeric (73.0) -
算術演算子。冪(べき乗)を計算します。
算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。
//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
... -
Integer
# pow(other) -> Numeric (73.0) -
算術演算子。冪(べき乗)を計算します。
算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。
//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
... -
Integer
# pow(other , modulo) -> Integer (73.0) -
算術演算子。冪(べき乗)を計算します。
算術演算子。冪(べき乗)を計算します。
@param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@raise RangeError 2引数 pow で other に負の数を指定した場合に発生します。
//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
...