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

ruby-changes:29110

From: akr <ko1@a...>
Date: Sat, 8 Jun 2013 12:01:47 +0900 (JST)
Subject: [ruby-changes:29110] akr:r41162 (trunk): * random.c (int_pair_to_real_inclusive): Use rb_funcall instead of

akr	2013-06-08 12:01:33 +0900 (Sat, 08 Jun 2013)

  New Revision: 41162

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

  Log:
    * random.c (int_pair_to_real_inclusive): Use rb_funcall instead of
      rb_big_mul because rb_integer_unpack can return a Fixnum.

  Modified files:
    trunk/ChangeLog
    trunk/random.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41161)
+++ ChangeLog	(revision 41162)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jun  8 11:59:55 2013  Tanaka Akira  <akr@f...>
+
+	* random.c (int_pair_to_real_inclusive): Use rb_funcall instead of
+	  rb_big_mul because rb_integer_unpack can return a Fixnum.
+
 Sat Jun  8 11:17:39 2013  Tanaka Akira  <akr@f...>
 
 	* random.c (int_pair_to_real_inclusive): Use rb_integer_pack.
Index: random.c
===================================================================
--- random.c	(revision 41161)
+++ random.c	(revision 41162)
@@ -293,7 +293,7 @@ int_pair_to_real_inclusive(uint32_t a, u https://github.com/ruby/ruby/blob/trunk/random.c#L293
     m = rb_integer_unpack(+1, mary, 2, sizeof(uint32_t), 0,
         INTEGER_PACK_MSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER);
 
-    x = rb_big_mul(x, m);
+    x = rb_funcall(x, '*', 1, m);
     if (FIXNUM_P(x)) {
 #if CHAR_BIT * SIZEOF_LONG > 64
 	r = (double)(FIX2ULONG(x) >> 64);

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

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