/* decl.h: Declarations for the "Newton" program. * * Written by Daniel Barrett. 100% PUBLIC DOMAIN. */ #include #include #ifdef UNIX #define BOOL short #define TRUE 1 #define FALSE 0 #else #include #endif #define MAX_DEGREE 20 /* Maximum degree of equation. */ #define MAX_ITERATIONS 10000 #define EPSILON_DEFAULT 0.0000001 #define EQUAL !strcmp #define SQR(x) ((x)*(x)) struct ComplexNumber { /* One complex number. */ double n[2]; /* Real & imaginary parts. */ }; typedef struct ComplexNumber complex; #define REAL 0 /* 1st element of ComplexNumber. */ #define IMAG 1 /* 2nd element of ComplexNumber. */ /* If C is of type "complex", then: * * C.n[REAL] is the real part. * C.n[IMAG] is the imaginary part. * */