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 11:41:38 +0200
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

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.

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]