diff options
author | shigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-20 04:13:30 +0000 |
---|---|---|
committer | shigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-20 04:13:30 +0000 |
commit | 611bb8f5a8771b618b8e81f08438fb770a8c2872 (patch) | |
tree | 016463f47efd2062770956cb79fb514e8337ca7a /ext/bigdecimal | |
parent | ebe96d582e3bf048637663d6c51524bd40c3d3eb (diff) |
Wrong descriptions,pointed out by Bret Jolly,in the documents changed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal')
-rw-r--r-- | ext/bigdecimal/bigdecimal_en.html | 9 | ||||
-rw-r--r-- | ext/bigdecimal/bigdecimal_ja.html | 7 |
2 files changed, 8 insertions, 8 deletions
diff --git a/ext/bigdecimal/bigdecimal_en.html b/ext/bigdecimal/bigdecimal_en.html index 02c88df43e..c2b86faef6 100644 --- a/ext/bigdecimal/bigdecimal_en.html +++ b/ext/bigdecimal/bigdecimal_en.html @@ -379,7 +379,7 @@ after every n digits for readability. <CODE><PRE> BigDecimal("0.1234567890123456789").to_s(10) # ==> "0.1234567890 123456789E0" </PRE></CODE> -n can be an string representing a positive integer number. +n can be a string representing a positive integer number. <CODE><PRE> BigDecimal("0.1234567890123456789").to_s("10") # ==> "0.1234567890 123456789E0" </PRE></CODE> @@ -678,10 +678,9 @@ structure. </DL> <H3>Disadvantage of decimal representation</H3> -Advantages stated so far can also be disadvantages if the input from outside is - represented in binary. -Translation error from decimal to binary or vice versa is inevitable. -So,translation from Float(binary) to BigDecimal(decimal) is not alway done exactly. +Because most computers have no internal decimal representaion. +Once you use BigDecimal,you need to keep using it without +considering computation cost if exact computation is required. <H4>Which is the first input?</H4> Because most people uses decimal notatin for numeric data representation, diff --git a/ext/bigdecimal/bigdecimal_ja.html b/ext/bigdecimal/bigdecimal_ja.html index 8fd95a6fe3..37bbcbbb09 100644 --- a/ext/bigdecimal/bigdecimal_ja.html +++ b/ext/bigdecimal/bigdecimal_ja.html @@ -676,10 +676,11 @@ exponent=1、sign=2 なら数値が 1234.56784321 であるのは見れば直ぐに分かります。 <H3>10進のデメリット</H3> 実は今までのメリットは、そのままデメリットにもなります。 -そもそも、10進を2進、2進を10進に変換するような操作は変換誤差 +そもそも、10進を2進に変換するような操作は変換誤差 を伴う場合を回避することはできません。 -既に計算機内部に取り込まれた2進数値を BigDecimal の内部表現に -変換するときには誤差が避けられない場合があります。 +大概のコンピュータは10進の内部表現を持っていないので、 +BigDecimal を利用して誤差無しの計算をする場合は、計算速度 +を無視しても最後まで BigDecimal を使用続ける必要があります。 <H3>最初は何か?</H3> 自分で計算するときにわざわざ2進数を使う人は極めてまれです。 |