Issue 5692 - Printing complex numbers with negative imaginary part
Summary: Printing complex numbers with negative imaginary part
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P2 minor
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-03 14:41 UTC by bearophile_hugs
Modified: 2013-06-22 23:36 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2011-03-03 14:41:40 UTC
A D2 program:

import std.stdio;
void main() {
    auto c = 0-1i;
    writeln(c);
}


It prints (dmd 2.052):
0+-1i

But I think the "+" sign is not needed, so I expect this output:
0-1i
Comment 2 github-bugzilla 2013-06-22 19:19:22 UTC
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/14a0a92c709fe368d2c18276b2463651848e068f
Issue 5692 - Fix printing of complex numbers with a negative imaginary part.
Removes redundant plus sign before the negative sign.
http://d.puremagic.com/issues/show_bug.cgi?id=5692

https://github.com/D-Programming-Language/phobos/commit/f85bd54ef5615986960fdd68ea87c8aaf5c5118d
Merge pull request #1366 from irritate/issue_5692

Issue 5692 - Fix printing of complex numbers with a negative imaginary p...