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

* 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/trunk@28698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2010-07-21 03:43:43 +00:00
parent 770af8649a
commit c618db17ee
2 changed files with 7 additions and 1 deletions

View file

@ -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]
Wed Jul 21 12:31:30 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
* lib/uri/common.rb: Have URI() and URI.join accept URI objects in
@ -15,6 +20,7 @@ Tue Jul 20 11:35:11 2010 Evan Phoenix <evan@ruby-lang.org>
Tue Jul 20 11:27:18 2010 Evan Phoenix <evan@ruby-lang.org>
* gem_prelude.rb: Pull in rubygem's custom require
* lib/rubygems.rb: Handle always having custom require available
Tue Jul 20 18:39:18 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>

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)