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

ruby-changes:31743

From: mrkn <ko1@a...>
Date: Sun, 24 Nov 2013 01:08:32 +0900 (JST)
Subject: [ruby-changes:31743] mrkn:r43822 (trunk): * ext/bigdecimal/bigdecimal.c (BigDecimal_power): Use FIX2LONG instead

mrkn	2013-11-24 01:08:23 +0900 (Sun, 24 Nov 2013)

  New Revision: 43822

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

  Log:
    * ext/bigdecimal/bigdecimal.c (BigDecimal_power): Use FIX2LONG instead
      of FIX2INT to avoid conversion error.

  Modified files:
    trunk/ChangeLog
    trunk/ext/bigdecimal/bigdecimal.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43821)
+++ ChangeLog	(revision 43822)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Nov 24 01:03:00 2013  Kenta Murata  <mrkn@m...>
+
+	* ext/bigdecimal/bigdecimal.c (BigDecimal_power): Use FIX2LONG instead
+	  of FIX2INT to avoid conversion error.
+
 Sun Nov 24 00:44:30 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): define by macros
Index: ext/bigdecimal/bigdecimal.c
===================================================================
--- ext/bigdecimal/bigdecimal.c	(revision 43821)
+++ ext/bigdecimal/bigdecimal.c	(revision 43822)
@@ -2194,7 +2194,7 @@ BigDecimal_power(int argc, VALUE*argv, V https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.c#L2194
 	return ToValue(y);
     }
 
-retry:
+  retry:
     switch (TYPE(vexp)) {
       case T_FIXNUM:
 	break;
@@ -2381,7 +2381,7 @@ retry: https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.c#L2381
 	}
     }
 
-    int_exp = FIX2INT(vexp);
+    int_exp = FIX2LONG(vexp);
     ma = int_exp;
     if (ma <  0) ma = -ma;
     if (ma == 0) ma = 1;

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

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