octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sparse + complex arithmetic inconsistency


From: Michael Goffioul
Subject: Re: Sparse + complex arithmetic inconsistency
Date: Fri, 30 Mar 2007 16:31:48 +0200

On 3/30/07, Rafael Laboissiere <address@hidden> wrote:

Does the gcc/g++ bug have something to do with the fact that the two
following lines produce different results in Octave (but shouldn't):

   octave2.9:1> ([1+i 1+i] ./ [0 i]) (1)
   ans = NaN - NaNi
   octave2.9:2> (1+i) / 0
   warning: division by zero
   ans = Inf + Infi

It looks like a problem in Octave.

The first one will call

std::complex<double>::operator / (std::complex<double>, double)

the second will call

std::complex<double>::operator / (std::complex<double>, std::complex<double>)

The fact is that in current C++ implementations, these 2 methods
return different results when the second argument is 0 (0+0i in the
second case). IMO, it's more a implementation problem in standard
C++ libraries, than a problem in Octave.

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]