rational.rb: avoid 'NaNi` representation.

Use `NaN*i` as CRuby does.
parent 6e1a1336
......@@ -8,7 +8,7 @@ class Complex < Numeric
end
def to_s
"#{real}#{'+' unless imaginary < 0}#{imaginary}i"
"#{real}#{'+' unless imaginary < 0}#{imaginary}#{'*' unless imaginary.finite?}i"
end
def +@
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment