summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--numeric.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f58ecf9a30..1a3c4aaebd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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]
diff --git a/numeric.c b/numeric.c
index b40f0695b8..73626e1c05 100644
--- a/numeric.c
+++ b/numeric.c
@@ -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);