зеркало из https://github.com/github/ruby.git
do not pass -infinity.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
50c1da22df
Коммит
0d7f4ad828
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче