[phobos] std.complex: ready for Phobos?

Don Clugston dclugston at googlemail.com
Tue Apr 20 03:35:28 PDT 2010


On 20 April 2010 11:06, Lars Tandle Kyllingstad <lars at kyllingen.net> wrote:
> Does Complex!BigInt (or Complex!int, for that matter) *ever* make sense?  I
> mean, yes, it *sounds* cool, and I'm normally against introducing gratuitous
> constraints on functionality, but in this case I think I prefer restricting
> T to real number types.
>
> Have in mind that not only will one have to disable (or introduce special
> cases for) abs() and arg(), but also some of the operations, in particular
> division and exponentiation.
>
> It all sounds like more work, more maintenance, more complex code (hur hur),
> for very little or no benefit.

I agree. Mathematically, complex integers are a fundamentally
different type (they are Gaussian integers, and have some interesting
properties which general complex numbers don't have, for example, they
can be primes) .
However, Complex!BigFloat will make sense. It's also possible to
imagine using a fixed-point type.
So eventually isFloatingPoint!T might change to a slightly more
general function. But I don't think we should worry about that for
now.


More information about the phobos mailing list