www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - std.complex will replace the built-in types

reply teo <teo.ubuntu yahoo.com> writes:
I read at http://dlang.org/phobos/std_complex.html that "Complex will 
eventually replace the built-in types cfloat, cdouble, creal, ifloat, 
idouble, and ireal".

Can someone elaborate why? What is wrong with the above types?
Aug 19 2012
parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Sunday, August 19, 2012 20:28:35 teo wrote:
 I read at http://dlang.org/phobos/std_complex.html that "Complex will
 eventually replace the built-in types cfloat, cdouble, creal, ifloat,
 idouble, and ireal".
 
 Can someone elaborate why? What is wrong with the above types?
I think that it came down to it being an unnecessary language complication that didn't really buy us anything (though I don't remember the exact reasons given). In general, the trend has been to have everything that doesn't need to be in the language in the library, and it was decided that the complex numbers would go that route. I believe that the names of the built-in complex types will eventually be aliase to the names in the standard library however, so the code using them will look very similar if not the same. - Jonathan M Davis
Aug 19 2012