Wht std.complex is needed?

Don nospam at nospam.com
Mon Apr 6 05:36:18 PDT 2009


Sam Hu wrote:
> Thank you!
> Anothe silly question then:What's the disadvantage to have the built-in type of i-type?
> 
> Regards,
> Sam

It's a very nasty type. It supports *, but isn't closed under *.
Which is really annoying for generic programming.

idouble x = 2i;
x *= x; // oops, this isn't imaginary. (BTW this currently compiles :o).




More information about the Digitalmars-d-learn mailing list