mconf.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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 little-endian computers, such as IBM PC, that follow the
  31. * IEEE 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. * Big-endian IEEE format is denoted MIEEE. On some RISC
  37. * systems such as Sun SPARC, double precision constants
  38. * must be stored on 8-byte address boundaries. Since integer
  39. * arrays may be aligned differently, the MIEEE configuration
  40. * may fail on such machines.
  41. *
  42. * To accommodate other types of computer arithmetic, all
  43. * constants are also provided in a normal decimal radix
  44. * which one can hope are correctly converted to a suitable
  45. * format by the available C language compiler. To invoke
  46. * this mode, define the symbol UNK.
  47. *
  48. * An important difference among these modes is a predefined
  49. * set of machine arithmetic constants for each. The numbers
  50. * MACHEP (the machine roundoff error), MAXNUM (largest number
  51. * represented), and several other parameters are preset by
  52. * the configuration symbol. Check the file const.c to
  53. * ensure that these values are correct for your computer.
  54. *
  55. * Configurations NANS, INFINITIES, MINUSZERO, and DENORMAL
  56. * may fail on many systems. Verify that they are supposed
  57. * to work on your computer.
  58. */
  59. /*
  60. Cephes Math Library Release 2.3: June, 1995
  61. Copyright 1984, 1987, 1989, 1995 by Stephen L. Moshier
  62. */
  63. /* Define if the `long double' type works. */
  64. #define HAVE_LONG_DOUBLE 1
  65. /* Define as the return type of signal handlers (int or void). */
  66. #define RETSIGTYPE void
  67. /* Define if you have the ANSI C header files. */
  68. #define STDC_HEADERS 1
  69. /* Define if your processor stores words with the most significant
  70. byte first (like Motorola and SPARC, unlike Intel and VAX). */
  71. /* #undef WORDS_BIGENDIAN */
  72. /* Define if floating point words are bigendian. */
  73. /* #undef FLOAT_WORDS_BIGENDIAN */
  74. /* The number of bytes in a int. */
  75. #define SIZEOF_INT 4
  76. /* Define if you have the <string.h> header file. */
  77. #define HAVE_STRING_H 1
  78. /* Name of package */
  79. #define PACKAGE "cephes"
  80. /* Version number of package */
  81. #define VERSION "2.7"
  82. /* Constant definitions for math error conditions
  83. */
  84. #define DOMAIN 1 /* argument domain error */
  85. #define SING 2 /* argument singularity */
  86. #define OVERFLOW 3 /* overflow range error */
  87. #define UNDERFLOW 4 /* underflow range error */
  88. #define TLOSS 5 /* total loss of precision */
  89. #define PLOSS 6 /* partial loss of precision */
  90. #define EDOM 33
  91. #define ERANGE 34
  92. /* Complex numeral. */
  93. typedef struct
  94. {
  95. double r;
  96. double i;
  97. } cmplx;
  98. #ifdef HAVE_LONG_DOUBLE
  99. /* Long double complex numeral. */
  100. typedef struct
  101. {
  102. long double r;
  103. long double i;
  104. } cmplxl;
  105. #endif
  106. /* Type of computer arithmetic */
  107. /* PDP-11, Pro350, VAX:
  108. */
  109. /* #define DEC 1 */
  110. /* Intel IEEE, low order words come first:
  111. */
  112. /* #define IBMPC 1 */
  113. /* Motorola IEEE, high order words come first
  114. * (Sun 680x0 workstation):
  115. */
  116. /* #define MIEEE 1 */
  117. /* UNKnown arithmetic, invokes coefficients given in
  118. * normal decimal format. Beware of range boundary
  119. * problems (MACHEP, MAXLOG, etc. in const.c) and
  120. * roundoff problems in pow.c:
  121. * (Sun SPARCstation)
  122. */
  123. #define UNK 1
  124. /* If you define UNK, then be sure to set BIGENDIAN properly. */
  125. #ifdef FLOAT_WORDS_BIGENDIAN
  126. #define BIGENDIAN 1
  127. #else
  128. #define BIGENDIAN 0
  129. #endif
  130. /* Define this `volatile' if your compiler thinks
  131. * that floating point arithmetic obeys the associative
  132. * and distributive laws. It will defeat some optimizations
  133. * (but probably not enough of them).
  134. *
  135. * #define VOLATILE volatile
  136. */
  137. #define VOLATILE
  138. /* For 12-byte long doubles on an i386, pad a 16-bit short 0
  139. * to the end of real constants initialized by integer arrays.
  140. *
  141. * #define XPD 0,
  142. *
  143. * Otherwise, the type is 10 bytes long and XPD should be
  144. * defined blank (e.g., Microsoft C).
  145. *
  146. * #define XPD
  147. */
  148. #define XPD 0,
  149. /* Define to support tiny denormal numbers, else undefine. */
  150. #define DENORMAL 1
  151. /* Define to ask for infinity support, else undefine. */
  152. #define INFINITIES 1
  153. /* Define to ask for support of numbers that are Not-a-Number,
  154. else undefine. This may automatically define INFINITIES in some files. */
  155. #define NANS 1
  156. /* Define to distinguish between -0.0 and +0.0. */
  157. #define MINUSZERO 1
  158. /* Define 1 for ANSI C atan2() function
  159. See atan.c and clog.c. */
  160. #define ANSIC 1
  161. /* Get ANSI function prototypes, if you want them. */
  162. #if 1
  163. /* #ifdef __STDC__ */
  164. #define ANSIPROT 1
  165. int mtherr ( char *, int );
  166. #else
  167. int mtherr();
  168. #endif
  169. /* Variable for error reporting. See mtherr.c. */
  170. extern int merror;