summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-11 14:49:54 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-11 14:49:54 +0000
commit50c1da22df2f499647bc52daab162f2aa0256fbc (patch)
tree009e861b466aa21127445ee598e8400093ce883b /lib
parent876e1b87e7c0f2175932d7814c4ffbd272e01471 (diff)
downloadruby-50c1da22df2f499647bc52daab162f2aa0256fbc.tar.gz
* 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
Diffstat (limited to 'lib')
-rw-r--r--lib/cmath.rb2
1 files changed, 1 insertions, 1 deletions
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))