it's time to change how things are printed

Don nospam at nospam.com
Thu Nov 18 12:13:19 PST 2010


Lars T. Kyllingstad wrote:
> First of all, I think Andrei has already implemented this in the write*() 
> functions.  I use this toString() style also for std.complex.Complex, and 
> I can print complex numbers no problem.

Really? It doesn't work for me.

import std.complex;
import std.stdio;

void main()
{
     cdouble z2 = 10 + 1.5e-6i;
     Complex!(double) z;
     z.re = 10;
     z.im = 1.5e-6;
     writefln("z= %.16f z2 = %.16f", z, z2);
}

Prints:
z = 10+1.5e-06i z2 = 10.0000000000000000+0.0000015000000000i


More information about the Digitalmars-d mailing list