Wht std.complex is needed?

Joel C. Salomon joelcsalomon at gmail.com
Mon Apr 6 09:45:31 PDT 2009


bearophile wrote:
> A better question can be: "What's the advantage of having a built-in imaginary type?" :-)
> You can find an answer here, from page 11:
> http://www.eecs.berkeley.edu/~wkahan/JAVAhurt.pdf
> But maybe those ideas aren't much true anymore today.

Why could you not make a struct imaginary, with complex defined by
something like:

	struct complex(T) {
		T re;
		imaginary(T) im;
		…
	}

This can get you all the benefits Kahan talks about.

—Joel Salomon


More information about the Digitalmars-d-learn mailing list