merges r28698 from trunk into ruby_1_9_2.

--
* lib/cmath.rb (CMath#cbrt): cbrt should accept a negative real
  numbers.  [ruby-core:31234]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2010-07-22 12:31:27 +00:00
parent 835dcc220e
commit 537d0cab1d
2 changed files with 6 additions and 1 deletions

View file

@ -85,7 +85,7 @@ module CMath
end
def cbrt(z)
if z.real? and z >= 0
if z.real?
cbrt!(z)
else
Complex(z) ** (1.0/3)