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

ruby-changes:29573

From: akr <ko1@a...>
Date: Tue, 25 Jun 2013 21:51:41 +0900 (JST)
Subject: [ruby-changes:29573] akr:r41625 (trunk): * bignum.c (big2dbl): Use (BDIGIT)1 instead of 1UL.

akr	2013-06-25 21:51:17 +0900 (Tue, 25 Jun 2013)

  New Revision: 41625

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

  Log:
    * bignum.c (big2dbl): Use (BDIGIT)1 instead of 1UL.
      (bary_mul_normal): Remove a useless cast.

  Modified files:
    trunk/ChangeLog
    trunk/bignum.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41624)
+++ ChangeLog	(revision 41625)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Jun 25 21:43:13 2013  Tanaka Akira  <akr@f...>
+
+	* bignum.c (big2dbl): Use (BDIGIT)1 instead of 1UL.
+	  (bary_mul_normal): Remove a useless cast.
+
 Tue Jun 25 21:26:00 2013  Kenta Murata  <mrkn@m...>
 
 	* ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Fix for the cases when
Index: bignum.c
===================================================================
--- bignum.c	(revision 41624)
+++ bignum.c	(revision 41625)
@@ -2618,7 +2618,7 @@ big2dbl(VALUE x) https://github.com/ruby/ruby/blob/trunk/bignum.c#L2618
 		d = ds[i] + BIGRAD*d;
 	    }
 	    dl = ds[i];
-	    if (bits && (dl & (1UL << (bits %= BITSPERDIG)))) {
+	    if (bits && (dl & ((BDIGIT)1 << (bits %= BITSPERDIG)))) {
 		int carry = (dl & ~(BDIGMAX << bits)) != 0;
 		if (!carry) {
 		    while (i-- > 0) {
@@ -3386,7 +3386,7 @@ bary_mul_normal(BDIGIT *zds, size_t zl, https://github.com/ruby/ruby/blob/trunk/bignum.c#L3386
 	if (dd == 0) continue;
 	n = 0;
 	for (j = 0; j < yl; j++) {
-	    BDIGIT_DBL ee = n + (BDIGIT_DBL)dd * yds[j];
+	    BDIGIT_DBL ee = n + dd * yds[j];
 	    n = zds[i + j] + ee;
 	    if (ee) zds[i + j] = BIGLO(n);
 	    n = BIGDN(n);

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

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