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

ruby-changes:15078

From: naruse <ko1@a...>
Date: Tue, 16 Mar 2010 17:38:37 +0900 (JST)
Subject: [ruby-changes:15078] Ruby:r26954 (trunk): * ext/bigdecimal/bigdecimal.c (VpCtoV): keep e's sign.

naruse	2010-03-16 17:38:14 +0900 (Tue, 16 Mar 2010)

  New Revision: 26954

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

  Log:
    * ext/bigdecimal/bigdecimal.c (VpCtoV): keep e's sign.
      When e doesn't over flow e * BASE_FIG but overflow e * 10,
      e will overflow.

  Modified files:
    trunk/ChangeLog
    trunk/ext/bigdecimal/bigdecimal.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 26953)
+++ ChangeLog	(revision 26954)
@@ -1,3 +1,9 @@
+Tue Mar 16 17:33:30 2010  NARUSE, Yui  <naruse@r...>
+
+	* ext/bigdecimal/bigdecimal.c (VpCtoV): keep e's sign.
+	  When e doesn't over flow e * BASE_FIG but overflow e * 10,
+	  e will overflow.
+
 Tue Mar 16 17:18:44 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* include/ruby/encoding.h (rb_str_conv_enc_opts): missing prototype.
Index: ext/bigdecimal/bigdecimal.c
===================================================================
--- ext/bigdecimal/bigdecimal.c	(revision 26953)
+++ ext/bigdecimal/bigdecimal.c	(revision 26954)
@@ -4045,6 +4045,7 @@
             e = e * 10 + exp_chr[i] - '0';
             if(es>e*((S_INT)BASE_FIG)) {
 		exponent_overflow = 1;
+		e = es;
 		break;
             }
             ++i;

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

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