るりまサーチ (Ruby 2.7.0)

最速Rubyリファレンスマニュアル検索!
10件ヒット [1-10件を表示] (0.146秒)
トップページ > 種類:インスタンスメソッド[x] > クエリ:l[x] > バージョン:2.7.0[x] > クエリ:p[x] > クラス:BigDecimal[x]

別のキーワード

  1. matrix l
  2. kernel $-l
  3. _builtin $-l
  4. lupdecomposition l
  5. l

ライブラリ

キーワード

検索結果

BigDecimal#split -> [Integer, String, Integer, Integer] (36607.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#dup -> BigDecimal (27607.0)

self を返すように、BigDecimal で定義されています。

...self を返すように、BigDecimal で定義されています。...

BigDecimal#_dump -> String (27307.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#exponent -> Integer (27307.0)

self の指数部を整数値で返します。

self の指数部を整数値で返します。

BigDecimal#inspect -> String (27307.0)

BigDecimal オブジェクトを表す文字列を返します。

...
BigDecimal
オブジェクトを表す文字列を返します。

//emlist[][ruby]{
require "bigdecimal"
BigDecimal
("1234.5678").inspect
# => "0.12345678e4"
//}...

絞り込み条件を変える

BigDecimal#precs -> [Integer, Integer] (27307.0)

self の有効数字と最大有効数字の配列を返します。

self の有効数字と最大有効数字の配列を返します。

BigDecimal#save_exception_mode { ... } -> object (27307.0)

例外処理に関する BigDecimal.mode の設定を保存してブロックを評価し ます。ブロック中で変更した設定はブロックの評価後に復元されます。

...例外処理に関する BigDecimal.mode の設定を保存してブロックを評価し
ます。ブロック中で変更した設定はブロックの評価後に復元されます。

ブロックの評価結果を返します。...

BigDecimal#power(n) -> BigDecimal (18607.0)

self の n 乗を計算します。

self の n 乗を計算します。

戻り値の有効桁数は self の有効桁数の n 倍以上になります。

@param n selfを other 乗する数を指定します。

@param prec 有効桁数を整数で指定します。


@see Integer#pow

BigDecimal#power(n, prec) -> BigDecimal (18607.0)

self の n 乗を計算します。

self の n 乗を計算します。

戻り値の有効桁数は self の有効桁数の n 倍以上になります。

@param n selfを other 乗する数を指定します。

@param prec 有効桁数を整数で指定します。


@see Integer#pow

BigDecimal#sign -> -3 | -2 | -1 | 0 | 1 | 2 | 3 (9151.0)

自身の符号等の性質に応じて、Integer を返します。

...であれば、 0。 BigDecimal::SIGN_NaN と同じです。
+0 であれば、 1。 BigDecimal::SIGN_POSITIVE_ZERO と同じです。
-0 であれば、-1。 BigDecimal::SIGN_NEGATIVE_ZERO と同じです。
有限の正の値 であれば、 2。 BigDecimal::SIGN_POSITIVE_FIN...
...負の値 であれば、-2。 BigDecimal::SIGN_NEGATIVE_FINITE と同じです。
+Infinity であれば、 3。 BigDecimal::SIGN_POSITIVE_INFINITE と同じです。
-Infinity であれば、-3。 BigDecimal::SIGN_NEGATIVE_INFINITE と同じです。

BigDecimal
は、 0 であっても、+...
...lib:bigdecimal#internal_structure」を参照)

//emlist[][ruby]{
require "bigdecimal"

p BigDecimal("NaN").sign # => 0
p BigDecimal("0").sign # => 1
p BigDecimal("100").sign # => 2
p BigDecimal("Infinity").sign # => 3
p BigDecimal("-0").sign # => -1
p BigDecimal("-5"...

絞り込み条件を変える