るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.095秒)
トップページ > クエリ:float[x] > クエリ:E[x] > クエリ:double_fig[x]

別のキーワード

  1. open3 popen2e
  2. socket af_e164
  3. matrix det_e
  4. open3 capture2e
  5. matrix rank_e

ライブラリ

クラス

検索結果

BigDecimal.double_fig -> Integer (24241.0)

Ruby の Float クラスが保持できる有効数字の数を返します。

... Float クラスが保持できる有効数字の数を返します。

//emlist[][ruby]{
require 'bigdecimal'
p BigDecimal::double_fig # ==> 16 (depends on the CPU etc.)
//}

double_fig
は以下の C プログラムの結果と同じです。

double v = 1.0;
int double_fig = 0;
while...
...(v + 1.0 > 1.0) {
++double_fig;
v /= 10;
}...