From 50c1da22df2f499647bc52daab162f2aa0256fbc Mon Sep 17 00:00:00 2001 From: tadf Date: Thu, 11 Dec 2008 14:49:54 +0000 Subject: * lib/cmath.rb (sqrt): should pass nan or infinity to the original method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/cmath.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1533043dfb..370eed3ff6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Dec 11 23:48:00 2008 Tadayoshi Funaba + + * lib/cmath.rb (sqrt): should pass nan or infinity to the original + method. + Thu Dec 11 21:04:04 2008 Kouhei Sutou * lib/rss/maker.rb, lib/rss/maker/0.9.rb, lib/rss/maker/base.rb: diff --git a/lib/cmath.rb b/lib/cmath.rb index 00bcc9087f..9705b277b0 100644 --- a/lib/cmath.rb +++ b/lib/cmath.rb @@ -57,7 +57,7 @@ module CMath 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)) -- cgit v1.2.3