回复:C programming problem

来源: 2005-06-17 10:49:14 [旧帖] [给我悄悄话] 本文已被阅读:

1. From RedHat Linux manual page

Your C-compiler can work with complex numbers if it supports the C99
standard. Link with -lm. The imaginary unit is represented by I.

/* check that exp(i*pi) == -1 */
#include /* for atan */
#include
main() {
double pi = 4*atan(1);
complex z = cexp(I*pi);
printf("%f+%f*i\n", creal(z), cimag(z));
}
I've never used it before. Just check the manual pages.

2. You need to define __USE_LARGEFILE64

Good luck.