complex numbers problem: with the first calculation I recieve NaN. With the second, everything is Ok.
Peter Volkov
pvolkov@mics.msu.su
Sun Sep 25 14:15:00 GMT 2005
Hello.
I'm not sure this is the right place to ask questions. May be this is
gcc related problem. Even this may be my problem. But I hope for some
help here.
The short description of my problem is here:
printf ("Vp = %e, D = %e, %e; KD1 =%e, %e.\n", priv->Vp[0],
creal(self->D[1]), cimag(self->D[1]), creal((0.5)*KD1[1]),
cimag((0.5)*KD1[1]));
printf ("%e, %e.\n", creal(priv->Vp[0]*(self->D[1] + 0.5*KD1[1])),
cimag(priv->Vp[0]*(self->D[1] + 0.5*KD1[1])));
This are two consequent lines of my code. The output is here:
Vp = -9.756559e-02, D = 0.000000e+00, 0.000000e+00; KD1 =0.000000e+00,
0.000000e+00.
-0.000000e+00, nan.
Vp is double. KC1, KD1 are complex double...
Why nan??? :( It seems to me that this is the libc's problem with
complex numbers. If I remove cimag(...) in the second printf I receive
nan in the second line of output in place of -0.000000e+00...
Please, help me. May be you can see here something I can not?
This program is written without threads. libc-3.3.5. gentoo
distribution.
Any way. Thank you for your time,
Peter.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20050925/808ae4f3/attachment.sig>
More information about the Libc-alpha
mailing list