Fixing the imaginary/complex mess

Derek Parnell derek at psych.ward
Mon May 4 05:20:11 PDT 2009


On Mon, 04 May 2009 10:56:41 +0200, Frits van Bommel wrote:

> Don wrote:
>> In the case complex = int/complex, there's no problem. It's the case int 
>> = int/complex that doesn't make sense.
>> And that's fundamentally because cast(real)(2 + 3i) doesn't have a 
>> definite answer.
> 
> Devil's advocate: one could argue it's the same as cast(int) of a float -- it 
> returns the closest representable value, for some definition of "closest".

Hmmm. not quite because we can not do ...

   int i = floatnum.integer;

but we can do 

   real r = complexnum.re;

-- 
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell



More information about the Digitalmars-d mailing list