Complex number functions for std.math
Don Clugston
dac at nospam.com.au
Sun Apr 9 23:47:43 PDT 2006
Norbert Nemec wrote:
> Don Clugston wrote:
>> I think we could easily amass a lobby group of 100% of the users of
>> complex numbers in D to have a 'complex' alias set up in math.d. And
>> gradually phase out use of creal (which I think would be better named
>> cfloat80 or similar -- make the underlying type itself be of fixed size).
>
> Well, the whole discussion is pretty much pointless unless Walter is
> willing to touch the topic again. When the topic came up two years ago,
> the final sentence was something like: "Well, I agree that creal sounds
> stupid, but we are not going to roll this up yet again." Obviously, the
> name "creal" was the result of a tedious discussion a little while
> before. That discussion was before my time and obviously nobody back
> then had strong feelings against talking about "really complex numbers".
> Therefore the final word still is: "Do in the library whatever you want,
> the language definition will not be changed again."
I'm OK with that, I really think it's all we need.
* Add the following lines to object.d:
alias ireal imaginary;
alias creal complex;
* Replace all uses of 'creal' in math.d with 'complex'.
* In the documentation, replace 'creal' in the docs with 'complex'.
A simple search-and-replace in both cases. It would only take five
minutes. No change to the compiler is required. It wouldn't break any
existing code.
Similar to, but much less disruptive than, the bit/bool change that was
just made.
I completely agree with Walter that 'extended' was a dreadful name for
80 bit floats. I really like 'real'. But since it's not a fixed size,
it's behaving exactly like an alias. It would be natural to have
corresponding aliases for 'imaginary' and 'complex'.
More information about the Digitalmars-d
mailing list