home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / astrnomy / de118i.zip / MCONF.H < prev    next >
Text File  |  1993-02-06  |  3KB  |  124 lines

  1. /*                            mconf.h
  2.  *
  3.  *    Common include file for math routines
  4.  *
  5.  *
  6.  *
  7.  * SYNOPSIS:
  8.  *
  9.  * #include "mconf.h"
  10.  *
  11.  *
  12.  *
  13.  * DESCRIPTION:
  14.  *
  15.  * This file contains definitions for error codes that are
  16.  * passed to the common error handling routine mtherr()
  17.  * (which see).
  18.  *
  19.  * The file also includes a conditional assembly definition
  20.  * for the type of computer arithmetic (IEEE, DEC, Motorola
  21.  * IEEE, or UNKnown).
  22.  *
  23.  * For Digital Equipment PDP-11 and VAX computers, certain
  24.  * IBM systems, and others that use numbers with a 56-bit
  25.  * significand, the symbol DEC should be defined.  In this
  26.  * mode, most floating point constants are given as arrays
  27.  * of octal integers to eliminate decimal to binary conversion
  28.  * errors that might be introduced by the compiler.
  29.  *
  30.  * For computers, such as IBM PC, that follow the IEEE 
  31.  * Standard for Binary Floating Point Arithmetic (ANSI/IEEE
  32.  * Std 754-1985), the symbol IBMPC should be defined.  These
  33.  * numbers have 53-bit significands.  In this mode, constants
  34.  * are provided as arrays of hexadecimal 16 bit integers.
  35.  *
  36.  * To accommodate other types of computer arithmetic, all
  37.  * constants are also provided in a normal decimal radix
  38.  * which one can hope are correctly converted to a suitable
  39.  * format by the available C language compiler.  To invoke
  40.  * this mode, the symbol UNK is defined.
  41.  *
  42.  * An important difference among these modes is a predefined
  43.  * set of machine arithmetic constants for each.  The numbers
  44.  * MACHEP (the machine roundoff error), MAXNUM (largest number
  45.  * represented), and several other parameters are preset by
  46.  * the configuration symbol.  Check the file const.c to
  47.  * ensure that these values are correct for your computer.
  48.  *
  49.  * For ANSI C compatibility, define ANSIC equal to 1.  Currently
  50.  * this affects only the atan2() function and others that use it.
  51.  */
  52.  
  53. /*
  54. Cephes Math Library Release 2.1:  January, 1989
  55. Copyright 1984, 1987, 1989 by Stephen L. Moshier
  56. Direct inquiries to 30 Frost Street, Cambridge, MA 02140
  57. */
  58.  
  59.  
  60. /* Constant definitions for math error conditions
  61.  */
  62.  
  63. #define DOMAIN        1    /* argument domain error */
  64. #define SING        2    /* argument singularity */
  65. #define OVERFLOW    3    /* overflow range error */
  66. #define UNDERFLOW    4    /* underflow range error */
  67. #define TLOSS        5    /* total loss of precision */
  68. #define PLOSS        6    /* partial loss of precision */
  69.  
  70. #define EDOM        33
  71. #define ERANGE        34
  72.  
  73. typedef struct
  74.     {
  75.     double r;
  76.     double i;
  77.     }cmplx;
  78.  
  79. /* Type of computer arithmetic */
  80.  
  81. /* PDP-11, Pro350, VAX:
  82.  */
  83. /*define DEC 1*/
  84.  
  85. /* Intel IEEE, low order words come first:
  86.  */
  87. #define IBMPC 1
  88.  
  89. /* Motorola IEEE, high order words come first
  90.  * (Macintosh, Sun workstation):
  91.  */
  92. /*define MIEEE 1*/
  93.  
  94. /* UNKnown arithmetic, invokes coefficients given in
  95.  * normal decimal format.  Beware of range boundary
  96.  * problems (MACHEP, MAXLOG, etc. in const.c) and
  97.  * roundoff problems in pow.c:
  98.  */
  99. /*#define UNK 1*/
  100.  
  101. /* Define 1 for ANSI C atan2() function
  102.  * See atan.c and clog.c.
  103.  */
  104. #define ANSIC 0
  105.  
  106. /* Define the compiler
  107.  */
  108. #define MSC 1
  109. #define RSX 0
  110. #define SVC 0
  111. #define UNIX 0
  112. #define VAX 0
  113.  
  114. /* For 12-byte long doubles on an i386, pad a 16-bit short 0
  115.  * to the end of real constants initialized by integer arrays.
  116.  * Otherwise, the type is 10 bytes long and XPD should be
  117.  * defined blank:
  118.  */
  119. #if MSC
  120. #define XPD
  121. #else
  122. #define XPD 0,
  123. #endif
  124.