aboutsummaryrefslogtreecommitdiffstats
path: root/lib/cmath.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-21 03:43:43 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-21 03:43:43 +0000
commitc618db17ee082b5b125bfea8410214058fc1fe17 (patch)
tree7078ea3239fb3e4821ff5fcca5b5c8127544a348 /lib/cmath.rb
parent770af8649a22f721408e75d7d92b5c4323472f28 (diff)
downloadruby-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
Diffstat (limited to 'lib/cmath.rb')
-rw-r--r--lib/cmath.rb2
1 files changed, 1 insertions, 1 deletions
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)