summaryrefslogtreecommitdiff
path: root/lib/cmath.rb
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-11 15:11:14 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-11 15:11:14 +0000
commit0d7f4ad8280aa09348488667986c656b7070521f ()
tree6040d6e4789412b77eb5e6a67ae1dc0d89a052e6 /lib/cmath.rb
parent50c1da22df2f499647bc52daab162f2aa0256fbc (diff)
do not pass -infinity.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/cmath.rb6
1 files changed, 3 insertions, 3 deletions
@@ -57,10 +57,10 @@ module CMath
def sqrt(z)
if z.real?
- if z >= 0 || (Float === z && (z.nan? || z.infinite?))
- sqrt!(z)
- else
Complex(0, sqrt!(-z))
end
else
if z.imag < 0