summaryrefslogtreecommitdiff
path: root/test/ruby/test_complex.rb
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-09 04:52:57 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-09 04:52:57 +0000
commitca927d60f4e6b82c61afd1447112abc2157ff622 (patch)
tree14b9b93f056784ee0346b2a2f323a24d74eb1936 /test/ruby/test_complex.rb
parentd3e5a29361a75f46c471b404479693bd6359ff0f (diff)
* 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
Diffstat (limited to 'test/ruby/test_complex.rb')
-rw-r--r--test/ruby/test_complex.rb4
1 files changed, 4 insertions, 0 deletions
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)