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

ruby-changes:12029

From: tadf <ko1@a...>
Date: Mon, 15 Jun 2009 22:40:33 +0900 (JST)
Subject: [ruby-changes:12029] Ruby:r23695 (trunk): * bignum.c (rb_big2db): (-Float::MAX.to_i*2).to_f should return

tadf	2009-06-15 22:39:18 +0900 (Mon, 15 Jun 2009)

  New Revision: 23695

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

  Log:
    * bignum.c (rb_big2db): (-Float::MAX.to_i*2).to_f should return
      -HUGE_VAL (-Infinity).

  Modified files:
    trunk/ChangeLog
    trunk/bignum.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 23694)
+++ ChangeLog	(revision 23695)
@@ -1,3 +1,8 @@
+Mon Jun 15 22:35:31 2009  Tadayoshi Funaba  <tadf@d...>
+
+	* bignum.c (rb_big2db): (-Float::MAX.to_i*2).to_f should return
+	  -HUGE_VAL (-Infinity).
+
 Mon Jun 15 18:48:41 2009  Yukihiro Matsumoto  <matz@r...>
 
 	* io.c (argf_each_line): should return self.  [ruby-core:23852]
Index: bignum.c
===================================================================
--- bignum.c	(revision 23694)
+++ bignum.c	(revision 23695)
@@ -1233,7 +1233,10 @@
 
     if (isinf(d)) {
 	rb_warning("Bignum out of Float range");
-	d = HUGE_VAL;
+	if (signbit(d))
+	  d = -HUGE_VAL;
+	else
+	  d = HUGE_VAL;
     }
     return d;
 }

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

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