diff --git a/ChangeLog b/ChangeLog index b1cfa903cc..7803c5edcf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Jul 21 12:39:15 2010 Yusuke Endoh + + * lib/cmath.rb (CMath#cbrt): cbrt should accept a negative real + numbers. [ruby-core:31234] + Thu Jul 15 21:43:35 2010 Yusuke Endoh * numeric.c (fix_divide): must not use rb_rational_new1 for coercion 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)