octave-maintainers
[Top][All Lists]
Advanced

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

Re: Sparse + complex arithmetic inconsistency


From: David Bateman
Subject: Re: Sparse + complex arithmetic inconsistency
Date: Fri, 30 Mar 2007 14:13:19 +0200
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

Michael Goffioul wrote:
> On 3/30/07, David Bateman <address@hidden> wrote:
>> Or a slightly modification
>>
>> #include <math.h>
>> #include <complex.h>
>> #include <stdio.h>
>> int main(int argc, char *argv[])
>> {
>>  complex double b=1,c=I*1,d = 1+I*1,z = 0.;
>>  // This should produce (inf,0), not (nan,nan).
>>  printf("(%f,%f) / (%f,%f) -> (%f,%f)\n",
>>         creal(b),cimag(b),creal(z),cimag(z),creal(b/z),cimag(b/z));
>>  // This should produce (0,inf), not (nan,nan).
>>  printf("(%f,%f) / (%f,%f) -> (%f,%f)\n",
>>         creal(c),cimag(c),creal(z),cimag(z),creal(c/z),cimag(c/z));
>>  // This should produce (inf,inf), not (nan,nan).
>>  printf("(%f,%f) / (%f,%f) -> (%f,%f)\n",
>>         creal(d),cimag(d),creal(z),cimag(z),creal(d/z),cimag(d/z));
>>  return 0;
>> }
>>
>> that all return (nan,nan) for me.
>
> I already reported this kind of problem some months ago. This is
> due to the complex arthmetic implementation and it also appears
> under MSVC. See
> http://www.nabble.com/Sparse-matrix-problem-tf2844890.html#a8149128
>
> You can even illustrate the problem without the use of sparse
> matrices, like:
>
> [1+i 1+i] ./ [0 i]
>
> Michael.
>
Following the bug report trail from this thread leads to

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=221319

and then

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30482

which leads to

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24581

and

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28408

No resolution from the GCC people is proposed, and all of the above bugs
are open. Hopefully, one day the gcc/g++ complex classes will be
mathematically correct :-(

D.

-- 
David Bateman                                address@hidden
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



reply via email to

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