diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-21 03:43:43 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-21 03:43:43 +0000 |
commit | c618db17ee082b5b125bfea8410214058fc1fe17 (patch) | |
tree | 7078ea3239fb3e4821ff5fcca5b5c8127544a348 | |
parent | 770af8649a22f721408e75d7d92b5c4323472f28 (diff) | |
download | ruby-c618db17ee082b5b125bfea8410214058fc1fe17.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/cmath.rb | 2 |
2 files changed, 7 insertions, 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] + 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> diff --git a/lib/cmath.rb b/lib/cmath.rb index b23dac239c..976f269299 100644 --- a/lib/cmath.rb +++ b/lib/cmath.rb @@ -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) |