* 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:
parent
f365778c26
commit
faea8893f8
@ -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>
|
Sun Jun 28 19:48:29 2009 Tadayoshi Funaba <tadf@dotrb.org>
|
||||||
|
|
||||||
* complex.c (nucomp_expt): some improvements.
|
* complex.c (nucomp_expt): some improvements.
|
||||||
|
@ -63,7 +63,8 @@ module CMath
|
|||||||
sqrt!(z)
|
sqrt!(z)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if z.imag < 0
|
if z.imag < 0 ||
|
||||||
|
(z.imag == 0 && z.imag.to_s[0] == '-')
|
||||||
sqrt(z.conjugate).conjugate
|
sqrt(z.conjugate).conjugate
|
||||||
else
|
else
|
||||||
r = z.abs
|
r = z.abs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user