git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tadf 2008-12-11 15:11:14 +00:00
Родитель 50c1da22df
Коммит 0d7f4ad828
2 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -1,7 +1,6 @@
Thu Dec 11 23:48:00 2008 Tadayoshi Funaba <tadf@dotrb.org>
* lib/cmath.rb (sqrt): should pass nan or infinity to the original
method.
* lib/cmath.rb (sqrt): should pass nan to the original method.
Thu Dec 11 21:04:04 2008 Kouhei Sutou <kou@cozmixng.org>

Просмотреть файл

@ -57,10 +57,10 @@ module CMath
def sqrt(z)
if z.real?
if z >= 0 || (Float === z && (z.nan? || z.infinite?))
sqrt!(z)
else
if z < 0
Complex(0, sqrt!(-z))
else
sqrt!(z)
end
else
if z.imag < 0