mconf.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. */
  50. /*
  51. Cephes Math Library Release 2.0: April, 1987
  52. by Stephen L. Moshier
  53. Direct inquiries to 30 Frost Street, Cambridge, MA 02140
  54. */
  55. /* Constant definitions for math error conditions
  56. */
  57. #define DOMAIN 1 /* argument domain error */
  58. #define SING 2 /* argument singularity */
  59. #define OVERFLOW 3 /* overflow range error */
  60. #define UNDERFLOW 4 /* underflow range error */
  61. #define TLOSS 5 /* total loss of precision */
  62. #define PLOSS 6 /* partial loss of precision */
  63. #define EDOM 33
  64. #define ERANGE 34
  65. /*
  66. typedef struct
  67. {
  68. double r;
  69. double i;
  70. }cmplx;
  71. */
  72. /* Type of computer arithmetic */
  73. /* PDP-11, Pro350, VAX:
  74. */
  75. /*define DEC 1*/
  76. /* Intel IEEE, low order words come first:
  77. */
  78. #define IBMPC 1
  79. /* Motorola IEEE, high order words come first
  80. * (Sun workstation):
  81. */
  82. /*define MIEEE 1*/
  83. /* UNKnown arithmetic, invokes coefficients given in
  84. * normal decimal format. Beware of range boundary
  85. * problems (MACHEP, MAXLOG, etc. in const.c) and
  86. * roundoff problems in pow.c:
  87. */
  88. /*define UNK 1*/
  89. /* Define to ask for infinity support, else undefine. */
  90. #define INFINITY
  91. /* Define to ask for Not-a-Number support, else undefine. */
  92. #define NANS
  93. /* Define to support denormal numbers, else undefine. */
  94. #define DENORMAL