1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
akr 2012-07-16 13:52:10 +00:00
parent e985c49e64
commit 0e2aa330ec
2 changed files with 7 additions and 1 deletions

View file

@ -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]

View file

@ -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);