Comparison of Imaginary types
Damian McGuckin
damianm at esi.com.au
Thu Jul 2 22:12:20 UTC 2026
On Thursday, 2 July 2026 at 16:33:28 UTC, Guillaume Piolat wrote:
> On Thursday, 2 July 2026 at 02:21:55 UTC, Damian McGuckin wrote:
>>
>> Are the "less than" and "greater than" operators supported on
>> the purely imaginary types which I find quite useful
>> occasionally?
>
> Probably, but.
> What would be the result then? It's clearer to write a.re <
> b.re || a.im < b.im
BY imaginary types, I meant D's purely imaginary types such as
ifloat and idouble. I know they have been deprecated but I am
hoping not yet eliminated.
While Descartes called numbers with a purely real and purely
imaginary components, Gauss started calling them complex. The
word imaginary, which Descartes had suggested as an insult, fell
out of favor from the time of Gauss. But, from about the 1920s,
the term imaginary made a comeback but was then reserved for the
non-real part of the complex number. Sadly since then, the use of
the term imaginary has been used too loose. Mind you, even the
use of real part and imaginary part is not always agreed upon,
the Oxford and Webster' dictionares both disagreeing. The current
contemporary usage is at odds with the original usage of the term
when Maclaurin first introduced it three centuries ago, 1727 I
think.
Enough of the history. So, given
ifloat a = 2i;
ifloat b = 4i;
The comparison
a < b
is perfectly clear.
Where is the documentation on these deprecated ifloat and cfloat
types please?
Thanks
More information about the Digitalmars-d-learn
mailing list