Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
tests for parsing complex numbers with scientific notation
  • Loading branch information
tinco committed May 8, 2011
commit c3efa5069a780308fee627ac11136eb55b52039a
4 changes: 4 additions & 0 deletions test/ruby/test_complex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,10 @@ def test_parse
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), '[email protected]'.to_c)
Expand Down