[前][次][番号順一覧][スレッド一覧]

ruby-changes:12007

From: shyouhei <ko1@a...>
Date: Fri, 12 Jun 2009 16:39:46 +0900 (JST)
Subject: [ruby-changes:12007] Ruby:r23671 (ruby_1_8_7): merge revision(s) 23662:

shyouhei	2009-06-12 16:39:31 +0900 (Fri, 12 Jun 2009)

  New Revision: 23671

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23671

  Log:
    merge revision(s) 23662:
    * ext/bigdecimal/bigdecimal.c (VpToString): fixed a bug introduced
      in r23613.  [ruby-talk:338957]

  Modified files:
    branches/ruby_1_8_7/ChangeLog
    branches/ruby_1_8_7/ext/bigdecimal/bigdecimal.c
    branches/ruby_1_8_7/version.h

Index: ruby_1_8_7/ext/bigdecimal/bigdecimal.c
===================================================================
--- ruby_1_8_7/ext/bigdecimal/bigdecimal.c	(revision 23670)
+++ ruby_1_8_7/ext/bigdecimal/bigdecimal.c	(revision 23671)
@@ -3803,7 +3803,7 @@
 /* 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 @@
     *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;
Index: ruby_1_8_7/ChangeLog
===================================================================
--- ruby_1_8_7/ChangeLog	(revision 23670)
+++ ruby_1_8_7/ChangeLog	(revision 23671)
@@ -1,3 +1,8 @@
+Fri Jun 12 16:36:44 2009  Yukihiro Matsumoto  <matz@r...>
+
+	* ext/bigdecimal/bigdecimal.c (VpToString): fixed a bug introduced
+	  in r23613.  [ruby-talk:338957]
+
 Mon Jun  8 10:58:41 2009  NAKAMURA Usaku  <usa@r...>
 
 	* eval.c (rb_thread_schedule): mswin32 doesn't have F_GETFD, so check
Index: ruby_1_8_7/version.h
===================================================================
--- ruby_1_8_7/version.h	(revision 23670)
+++ ruby_1_8_7/version.h	(revision 23671)
@@ -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[];

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]