mirror of
https://github.com/ruby/ruby.git
synced 2025-09-18 01:54:00 +02:00
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:
parent
835dcc220e
commit
537d0cab1d
2 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue