it's time to change how things are printed

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Thu Nov 18 14:41:45 PST 2010


On Thu, 18 Nov 2010 21:13:19 +0100, Don wrote:

> 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

Hm.  It must be calling toString() without any parameters then.  It's 
strange, I was sure I had tested it with different format strings...

-Lars


More information about the Digitalmars-d mailing list