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

ruby-changes:9109

From: tadf <ko1@a...>
Date: Thu, 11 Dec 2008 23:50:11 +0900 (JST)
Subject: [ruby-changes:9109] Ruby:r20646 (trunk): * lib/cmath.rb (sqrt): should pass nan or infinity to the original

tadf	2008-12-11 23:49:54 +0900 (Thu, 11 Dec 2008)

  New Revision: 20646

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

  Log:
    * lib/cmath.rb (sqrt): should pass nan or infinity to the original
      method.

  Modified files:
    trunk/ChangeLog
    trunk/lib/cmath.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 20645)
+++ ChangeLog	(revision 20646)
@@ -1,3 +1,8 @@
+Thu Dec 11 23:48:00 2008  Tadayoshi Funaba  <tadf@d...>
+
+	* lib/cmath.rb (sqrt): should pass nan or infinity to the original
+	  method.
+
 Thu Dec 11 21:04:04 2008  Kouhei Sutou  <kou@c...>
 
 	* lib/rss/maker.rb, lib/rss/maker/0.9.rb, lib/rss/maker/base.rb:
Index: lib/cmath.rb
===================================================================
--- lib/cmath.rb	(revision 20645)
+++ lib/cmath.rb	(revision 20646)
@@ -57,7 +57,7 @@
 
   def sqrt(z)
     if z.real?
-      if z >= 0
+      if z >= 0 || (Float === z && (z.nan? || z.infinite?))
 	sqrt!(z)
       else
 	Complex(0, sqrt!(-z))

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

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