PageRenderTime 38ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/haveged-1.4/nist/mconf.h

#
C Header | 169 lines | 28 code | 21 blank | 120 comment | 0 complexity | acc191e07612a8da30e35cccf02203d1 MD5 | raw file
Possible License(s): GPL-3.0
  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. /* Constant definitions for math error conditions
  64. */
  65. #ifndef DOMAIN
  66. #define DOMAIN 1 /* argument domain error */
  67. #define SING 2 /* argument singularity */
  68. #define OVERFLOW 3 /* overflow range error */
  69. #define UNDERFLOW 4 /* underflow range error */
  70. #define TLOSS 5 /* total loss of precision */
  71. #define PLOSS 6 /* partial loss of precision */
  72. #define EDOM 33
  73. #define ERANGE 34
  74. #endif
  75. /* Complex numeral. */
  76. typedef struct
  77. {
  78. double r;
  79. double i;
  80. } cmplx;
  81. /* Long double complex numeral. */
  82. /*
  83. typedef struct
  84. {
  85. long double r;
  86. long double i;
  87. } cmplxl;
  88. */
  89. /* Type of computer arithmetic */
  90. /* PDP-11, Pro350, VAX:
  91. */
  92. /* #define DEC 1 */
  93. /* Intel IEEE, low order words come first:
  94. */
  95. /*#define IBMPC 1 */
  96. /* Motorola IEEE, high order words come first
  97. * (Sun 680x0 workstation):
  98. */
  99. /* #define MIEEE 1 */
  100. /* UNKnown arithmetic, invokes coefficients given in
  101. * normal decimal format. Beware of range boundary
  102. * problems (MACHEP, MAXLOG, etc. in const.c) and
  103. * roundoff problems in pow.c:
  104. * (Sun SPARCstation)
  105. */
  106. #define UNK 1
  107. /* If you define UNK, then be sure to set BIGENDIAN properly. */
  108. #define BIGENDIAN 0
  109. /* Define this `volatile' if your compiler thinks
  110. * that floating point arithmetic obeys the associative
  111. * and distributive laws. It will defeat some optimizations
  112. * (but probably not enough of them).
  113. *
  114. * #define VOLATILE volatile
  115. */
  116. #define VOLATILE
  117. /* For 12-byte long doubles on an i386, pad a 16-bit short 0
  118. * to the end of real constants initialized by integer arrays.
  119. *
  120. * #define XPD 0,
  121. *
  122. * Otherwise, the type is 10 bytes long and XPD should be
  123. * defined blank (e.g., Microsoft C).
  124. *
  125. * #define XPD
  126. */
  127. #define XPD 0,
  128. /* Define to support tiny denormal numbers, else undefine. */
  129. #define DENORMAL 1
  130. /* Define to ask for infinity support, else undefine. */
  131. /* #define INFINITIES 1 */
  132. /* Define to ask for support of numbers that are Not-a-Number,
  133. else undefine. This may automatically define INFINITIES in some files. */
  134. /* #define NANS 1 */
  135. /* Define to distinguish between -0.0 and +0.0. */
  136. /* #define MINUSZERO 1 */
  137. /* Define 1 for ANSI C atan2() function
  138. See atan.c and clog.c. */
  139. #define ANSIC 1
  140. /* Get ANSI function prototypes, if you want them. */
  141. #ifdef __STDC__
  142. #define ANSIPROT
  143. #include "cephes-protos.h"
  144. #else
  145. int mtherr();
  146. #endif
  147. /* Variable for error reporting. See mtherr.c. */
  148. extern int merror;