mirror of
https://github.com/ruby/ruby.git
synced 2025-09-18 10:03:59 +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
|
@ -1,3 +1,8 @@
|
|||
Wed Jul 21 12:39:15 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* lib/cmath.rb (CMath#cbrt): cbrt should accept a negative real
|
||||
numbers. [ruby-core:31234]
|
||||
|
||||
Thu Jul 15 21:43:35 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* numeric.c (fix_divide): must not use rb_rational_new1 for coercion
|
||||
|
|
|
@ -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