From e6bea8978c9ec6b69a546f68416dd87dacac8b2a Mon Sep 17 00:00:00 2001 From: mrkn Date: Mon, 13 Jun 2011 05:36:59 +0000 Subject: * lib/cmath.rb (CMath.cbrt): returns the principal value of the cube root of the argument. fix #3676 * test/test_cmath.rb (test_cbrt_returns_principal_value_of_cube_root): test for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/test_cmath.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/test_cmath.rb b/test/test_cmath.rb index 46a357fab2..4f85ec3d04 100644 --- a/test/test_cmath.rb +++ b/test/test_cmath.rb @@ -5,4 +5,8 @@ class TestCMath < Test::Unit::TestCase def test_sqrt assert_equal CMath.sqrt(1.0.i), CMath.sqrt(1.i), '[ruby-core:31672]' end + + def test_cbrt_returns_principal_value_of_cube_root + assert_equal CMath.cbrt(-8), (-8)**(1.0/3), '#3676' + end end -- cgit v1.2.3