diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-16 13:52:10 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-16 13:52:10 +0000 |
commit | 0e2aa330ec5e16b237127db46ebde4eacc84f8c5 (patch) | |
tree | bc9af1552f0beb10f7b59bb1b8358ff24178325a | |
parent | e985c49e64ab820b1386541646e9d59ad600106d (diff) | |
download | ruby-0e2aa330ec5e16b237127db46ebde4eacc84f8c5.tar.gz |
* numeric.c (flo_to_s): use the exponential form if the integer part
is longer than or equal DBL_DIG.
[ruby-dev:45960] [ruby-trunk - Bug #6741]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | numeric.c | 2 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Mon Jul 16 22:50:41 2012 Tanaka Akira <akr@fsij.org> + + * numeric.c (flo_to_s): use the exponential form if the integer part + is longer than or equal DBL_DIG. + [ruby-dev:45960] [ruby-trunk - Bug #6741] + Mon Jul 16 22:01:00 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com> * ext/readline/readline.c: fixed docs. [Bug #6740][ruby-core:46501] @@ -662,7 +662,7 @@ flo_to_s(VALUE flt) buf[decpt] = '.'; rb_str_cat(s, buf, digs + 1); } - else if (decpt - digs < float_dig) { + else if (decpt <= DBL_DIG) { long len; char *ptr; rb_str_cat(s, buf, digs); |