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

merges r20646 and r20647 from trunk into ruby_1_9_1.

* lib/cmath.rb (sqrt): should pass nan or infinity to the original
	  method.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yugui 2008-12-13 01:03:25 +00:00
parent 8f8000beee
commit 2adcc421f3
2 changed files with 7 additions and 3 deletions

View file

@ -1,3 +1,7 @@
Thu Dec 11 23:48:00 2008 Tadayoshi Funaba <tadf@dotrb.org>
* lib/cmath.rb (sqrt): should pass nan to the original method.
Thu Dec 11 19:31:45 2008 Tanaka Akira <akr@fsij.org>
* lib/test/unit/assertions.rb: extracted from lib/test/unit.rb.

View file

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