[
https://issues.apache.org/jira/browse/MATH-614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13065195#comment-13065195
]
Gilles commented on MATH-614:
-----------------------------
My output of "toString" is no more ambiguous than yours, as far as it reflect
the internal state of the Complex class instance. And IMO, it is more legible
in cases like
* {{a + 1i}} vs {{(a, 1)}}
* {{a + 0i}} vs {{(a, 0)}}
* {{0 + bi}} vs {{(0, b)}}
* {{0 + 0i}} vs {{(0, 0)}}
* {{a + -bi}} vs {{(a, -b)}}
However, if a majority of people favour your alternative, I'll change it.
Also, please note that you can have full control over the format by using the
"ComplexFormat" class which can, for example, output a nice (and
generally-accepted)
{noformat}
a - bi
{noformat}
instead of
{noformat}
a + -bi
{noformat}
> "toString" method for "Complex"
> -------------------------------
>
> Key: MATH-614
> URL: https://issues.apache.org/jira/browse/MATH-614
> Project: Commons Math
> Issue Type: Wish
> Reporter: Gilles
> Assignee: Gilles
> Priority: Trivial
> Fix For: 3.0
>
> Attachments: math.patch
>
>
> Class "Complex" (in package "complex") lacks a "toString()" method.
> [Request from Arne Ploese on the "dev" ML.]
> I also propose to slightly modify the "format" method in "ComplexFormat" so
> that the stringified version of "Complex(1, 1)" is "1 + i" instead of "1 +
> 1i".
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira