1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/cmath.rb (sqrt): fixed an issue [ruby-list:45852]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tadf 2009-06-28 12:20:02 +00:00
parent f365778c26
commit faea8893f8
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Sun Jun 28 21:16:48 2009 Tadayoshi Funaba <tadf@dotrb.org>
* lib/cmath.rb (sqrt): fixed an issue [ruby-list:45852].
Sun Jun 28 19:48:29 2009 Tadayoshi Funaba <tadf@dotrb.org>
* complex.c (nucomp_expt): some improvements.

View file

@ -63,7 +63,8 @@ module CMath
sqrt!(z)
end
else
if z.imag < 0
if z.imag < 0 ||
(z.imag == 0 && z.imag.to_s[0] == '-')
sqrt(z.conjugate).conjugate
else
r = z.abs