summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-12 07:39:31 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-12 07:39:31 +0000
commit5eef94c8ced11a5d39c38566492cf059c92d8ad2 (patch)
tree496643b2b8727f617a29cfca8f2def59646751d8
parentca94967d3efd6ed837c39933c721461fc18a01bb (diff)
merge revision(s) 23662:
* ext/bigdecimal/bigdecimal.c (VpToString): fixed a bug introduced in r23613. [ruby-talk:338957] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@23671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/bigdecimal/bigdecimal.c18
-rw-r--r--version.h8
3 files changed, 21 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 9dce8fe71a..a435efdb94 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jun 12 16:36:44 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * ext/bigdecimal/bigdecimal.c (VpToString): fixed a bug introduced
+ in r23613. [ruby-talk:338957]
+
Mon Jun 8 10:58:41 2009 NAKAMURA Usaku <usa@ruby-lang.org>
* eval.c (rb_thread_schedule): mswin32 doesn't have F_GETFD, so check
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 4264d22c9f..03fafaf0d7 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -3803,7 +3803,7 @@ VpToString(Real *a,char *psz,int fFmt,int fPlus)
/* fPlus =0:default, =1: set ' ' before digits , =2:set '+' before digits. */
{
U_LONG i, ZeroSup;
- U_LONG n, e;
+ U_LONG n, m, e, nn;
char *pszSav = psz;
S_LONG ex;
@@ -3819,12 +3819,18 @@ VpToString(Real *a,char *psz,int fFmt,int fPlus)
*psz++ = '.';
n = a->Prec;
for(i=0;i < n;++i) {
+ m = BASE1;
e = a->frac[i];
- if((!ZeroSup) || e) {
- sprintf(psz, "%lu", e); /* The reading zero(s) */
- psz += strlen(psz);
- /* as 0.00xx will be ignored. */
- ZeroSup = 0; /* Set to print succeeding zeros */
+ while(m) {
+ nn = e / m;
+ if((!ZeroSup) || nn) {
+ sprintf(psz, "%lu", nn); /* The reading zero(s) */
+ psz += strlen(psz);
+ /* as 0.00xx will be ignored. */
+ ZeroSup = 0; /* Set to print succeeding zeros */
+ }
+ e = e - nn * m;
+ m /= 10;
}
}
ex =(a->exponent) * BASE_FIG;
diff --git a/version.h b/version.h
index 7dc9ecf88c..cae2827132 100644
--- a/version.h
+++ b/version.h
@@ -1,15 +1,15 @@
#define RUBY_VERSION "1.8.7"
-#define RUBY_RELEASE_DATE "2009-06-08"
+#define RUBY_RELEASE_DATE "2009-06-12"
#define RUBY_VERSION_CODE 187
-#define RUBY_RELEASE_CODE 20090608
-#define RUBY_PATCHLEVEL 173
+#define RUBY_RELEASE_CODE 20090612
+#define RUBY_PATCHLEVEL 174
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
#define RUBY_VERSION_TEENY 7
#define RUBY_RELEASE_YEAR 2009
#define RUBY_RELEASE_MONTH 6
-#define RUBY_RELEASE_DAY 8
+#define RUBY_RELEASE_DAY 12
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];