On 11/24/13 10:03 AM, Shammah Chancellor wrote:
On 2013-11-24 18:00:45 +0000, Andrei Alexandrescu said:

On 11/24/13 9:54 AM, Joseph Rushton Wakeling wrote:
On 23/11/13 08:43, Ali Çehreli wrote:
import std.stdio;
import std.complex;

void main()
{
writeln(complex(1.0L, -real.infinity) * complex(0.0, 1.0L));
writeln((1L - ireal.infinity) * 1i);
}


The output:

inf-nani    <-- "incorrect" according to the quoted page
inf+1i      <-- correct

It's because 0.0L * (-real.infinity) evaluates to nan.

Has this been submitted as a bug report?

Andrei

It's more a fundamental problem with a complex type in general.   C++
has this issue as well.   You need a purely imaginary type with the
appropiate operations between Complex and Imaginary defined.

But that originates as a call to multiplication between two Complex numbers. Can't the problem be addressed at that level?

Andrei

Reply via email to