Complex number functions for std.math

Norbert Nemec Norbert at Nemec-online.de
Sat Apr 8 13:03:50 PDT 2006


Don Clugston wrote:
> It is a bit of an oxymoron. I do like the idea of having 'complex' as a
> standard alias in std.math. It should operate almost as a reserved word,
> users should not be defining it to be anything other than creal.
> But I would not like to have to type "imaginary" instead of "ireal" --
> it's just too long. Any ideas on that one?

It would not be a problem that "imaginary" is such a long word: this
type is hardly ever used when coding. Maybe in special places inside a
library, but I cannot imagine any user-code that actually needs to
declare a variable of that type. Either you code real or complex, but
coding purely imaginary is pointless.

> FWIW, the name "imaginary" is a bit stupid, too. In what sense is a
> negative "real" number more "real" than an "imaginary" number? Arguably,
> D is just continuing the trend of inappropriate names <g>.

Well, I tend to think about redefining nonsensical conventions myself. I
just hate it when *others* do it. :-)

Seriously: communications is never about using the "right" term, but
always about using a term that people understand most easily. And the
best way to handle stupid conventions: don't change them unless you
already are an unquestioned guru in the field.



More information about the Digitalmars-d mailing list