[Pkg-octave-devel] Re: Sparse + complex arithmetic inconsistency
David Bateman
David.Bateman at motorola.com
Fri Mar 30 10:41:38 UTC 2007
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 David.Bateman at motorola.com
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
More information about the Pkg-octave-devel
mailing list