home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 177.lha / Newton_v1.0 / decl.h < prev    next >
C/C++ Source or Header  |  1988-04-28  |  782b  |  38 lines

  1. /* decl.h:    Declarations for the "Newton" program.
  2.  *
  3.  * Written by Daniel Barrett.  100% PUBLIC DOMAIN. */
  4.  
  5. #include <stdio.h>
  6. #include <math.h>
  7.  
  8. #ifdef UNIX
  9. #define    BOOL    short
  10. #define    TRUE    1
  11. #define    FALSE    0
  12. #else
  13. #include <exec/types.h>
  14. #endif
  15.     
  16. #define MAX_DEGREE    20        /* Maximum degree of equation. */
  17. #define    MAX_ITERATIONS    10000
  18. #define    EPSILON_DEFAULT    0.0000001
  19.  
  20. #define    EQUAL        !strcmp
  21. #define    SQR(x)        ((x)*(x))
  22.     
  23. struct ComplexNumber {            /* One complex number.     */
  24.     double n[2];            /* Real & imaginary parts. */
  25. };
  26. typedef struct ComplexNumber complex;
  27.  
  28. #define    REAL        0        /* 1st element of ComplexNumber. */
  29. #define    IMAG        1        /* 2nd element of ComplexNumber. */
  30.  
  31.  
  32. /* If C is of type "complex", then:
  33.  *
  34.  *    C.n[REAL]    is the real part.
  35.  *    C.n[IMAG]    is the imaginary part.
  36.  *
  37. */
  38.