[Issue 10881] Support %f formatting for a std.complex.complex

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 24 19:50:12 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10881



--- Comment #7 from bearophile_hugs at eml.cc 2013-08-24 19:50:05 PDT ---
This is a small use case:


void main() {
    import std.stdio, std.complex, std.math;
    alias C = complex;
    immutable x = 2 ^^ 0.5 / 2;
    immutable M = [[C(x,    0.0), C(x,   0.0), C(0.0, 0.0)],
                   [C(0.0, -x),   C(0.0, x),   C(0.0, 0.0)],
                   [C(0.0,  0.0), C(0.0, 0.0), C(0.0, 1.0)]];
    writefln("[%([%(%s, %)],\n %)]]", M);
}



It prints:

[[0.707107+0i, 0.707107+0i, 0+0i],
 [0-0.707107i, 0+0.707107i, 0+0i],
 [0+0i, 0+0i, 0+1i]]

But I'd like the columns to be aligned vertically, to increase the readability
of the matrix.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list