/* 文件 complex.h */

#if !defined(COMPLEX_HEAD_FILE1)
#define COMPLEX_HEAD_FILE1

/* 类型定义 */
typedef struct {
    double re, im;
} Complex;

/* 常量声明 */
extern const Complex Complex0;
extern const Complex Complex1;
extern const Complex ComplexI;

/* 构造函数 */
Complex mkComplex(double re, double im);
Complex d2Complex(double d);
Complex n2Complex(int n);

/* 运算函数 */
Complex addComplex(Complex x, Complex y);
Complex subComplex(Complex x, Complex y);
Complex tmsComplex(Complex x, Complex y);
Complex divComplex(Complex x, Complex y);
/* ... ... 其他函数原型 */

/* 比较函数 */
int eqComplex(Complex x, Complex y);

/* 输入输出函数 */
int readComplex(FILE *fp, Complex *xp);
void prtComplex(FILE *fp, Complex x);

#endif

