You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gilles (JIRA)" <ji...@apache.org> on 2011/07/12 23:32:59 UTC

[jira] [Created] (MATH-617) "ComplexFormat" when the imaginary part is equal to "1" (as a formatted string)

"ComplexFormat" when the imaginary part is equal to "1" (as a formatted string)
-------------------------------------------------------------------------------

                 Key: MATH-617
                 URL: https://issues.apache.org/jira/browse/MATH-617
             Project: Commons Math
          Issue Type: Improvement
            Reporter: Gilles
            Assignee: Gilles
            Priority: Trivial
             Fix For: 3.0


Currently, for the instance 
{code}
Complex(1, 1)
{code}
the "format" method in "ComplexFormat" outputs
{noformat}
1 + 1i
{noformat} 
Shall I modify the code so that it will output a nicer
{noformat}
1 + i
{noformat}
instead?


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (MATH-617) "ComplexFormat" when the imaginary part is equal to "1" (as a formatted string)

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz resolved MATH-617.
------------------------------

    Resolution: Fixed

Looks great.  The test I was suggesting is what the code is effectively doing and with no performance impact, since the formatting is happening anyway.

> "ComplexFormat" when the imaginary part is equal to "1" (as a formatted string)
> -------------------------------------------------------------------------------
>
>                 Key: MATH-617
>                 URL: https://issues.apache.org/jira/browse/MATH-617
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Trivial
>             Fix For: 3.0
>
>
> Currently, for the instance 
> {code}
> Complex(1, 1)
> {code}
> the "format" method in "ComplexFormat" outputs
> {noformat}
> 1 + 1i
> {noformat} 
> Shall I modify the code so that it will output a nicer
> {noformat}
> 1 + i
> {noformat}
> instead?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-617) "ComplexFormat" when the imaginary part is equal to "1" (as a formatted string)

Posted by "Gilles (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13065324#comment-13065324 ] 

Gilles commented on MATH-617:
-----------------------------

I've committed the code in revision 1146755.

Please have a look; I have no idea of the use of "FieldPosition" in these methods, so this change might screw up some possible usage (although all the tests pass).
It might well be that your suggestion is less intrusive and faster too...


> "ComplexFormat" when the imaginary part is equal to "1" (as a formatted string)
> -------------------------------------------------------------------------------
>
>                 Key: MATH-617
>                 URL: https://issues.apache.org/jira/browse/MATH-617
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Trivial
>             Fix For: 3.0
>
>
> Currently, for the instance 
> {code}
> Complex(1, 1)
> {code}
> the "format" method in "ComplexFormat" outputs
> {noformat}
> 1 + 1i
> {noformat} 
> Shall I modify the code so that it will output a nicer
> {noformat}
> 1 + i
> {noformat}
> instead?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MATH-617) "ComplexFormat" when the imaginary part is equal to "1" (as a formatted string)

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064682#comment-13064682 ] 

Phil Steitz commented on MATH-617:
----------------------------------

Testing for equality modulo configured number format precision, I assume?  There may be a miniscule performance impact to do the test, but I don't think that should be a showstopper for toString and I agree the modified output looks nicer, so +1 for this change.

> "ComplexFormat" when the imaginary part is equal to "1" (as a formatted string)
> -------------------------------------------------------------------------------
>
>                 Key: MATH-617
>                 URL: https://issues.apache.org/jira/browse/MATH-617
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Trivial
>             Fix For: 3.0
>
>
> Currently, for the instance 
> {code}
> Complex(1, 1)
> {code}
> the "format" method in "ComplexFormat" outputs
> {noformat}
> 1 + 1i
> {noformat} 
> Shall I modify the code so that it will output a nicer
> {noformat}
> 1 + i
> {noformat}
> instead?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira