From ca927d60f4e6b82c61afd1447112abc2157ff622 Mon Sep 17 00:00:00 2001 From: mrkn Date: Mon, 9 May 2011 04:52:57 +0000 Subject: * complex.c (string_to_c_internal): support scientific notation. patched by Tinco Andringa. https://github.com/ruby/ruby/pull/16 [ruby-core:36046][Bug #4655] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_complex.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/ruby/test_complex.rb b/test/ruby/test_complex.rb index e364c97d9a..24083e1384 100644 --- a/test/ruby/test_complex.rb +++ b/test/ruby/test_complex.rb @@ -704,6 +704,10 @@ class Complex_Test < Test::Unit::TestCase assert_equal(Complex(-0.33), '-0.33'.to_c) assert_equal(Complex(-0.33), '-0.3_3'.to_c) + assert_equal(Complex(2, 2e4), '2+2e4i'.to_c) + assert_equal(Complex(2e3, 2), '2e3+2i'.to_c) + assert_equal(Complex(2e3, 2e4), '2e3+2e4i'.to_c) + assert_equal(Complex.polar(10,10), '10@10'.to_c) assert_equal(Complex.polar(-10,-10), '-10@-10'.to_c) assert_equal(Complex.polar(10.5,10.5), '10.5@10.5'.to_c) -- cgit v1.2.3