std.complex

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Tue Nov 26 00:37:27 PST 2013


On 23/11/13 10:42, Joseph Rushton Wakeling wrote:
> Must say that, whatever the behind-the-scenes of the implementation, it seems a
> shame to lose the nice z = x + y*i notation.
>
> OTOH I guess that could lead to ambiguous code, e.g.
>
>      int i = 4;
>      complex z = x + y*i;     // what does i mean here?

I was wrong about this -- you have to write

     complex z = x + y * 1i

... which is unambiguous though I guess potentially still prone to typos :-)



More information about the Digitalmars-d mailing list