7件ヒット
[1-7件を表示]
(0.104秒)
ライブラリ
- ビルトイン (3)
- bigdecimal (2)
-
bigdecimal
/ util (2)
クラス
- BigDecimal (2)
- Float (2)
- Integer (3)
検索結果
先頭5件
-
BigDecimal
# sign -> -3 | -2 | -1 | 0 | 1 | 2 | 3 (51418.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 (51178.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,... -
Float
# to _ d -> BigDecimal (430.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 (430.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 (76.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 (76.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 (76.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
...