~ubuntu-branches/ubuntu/saucy/python-scipy/saucy

« back to all changes in this revision

Viewing changes to scipy/special/cephes/mconf.h

  • Committer: Bazaar Package Importer
  • Author(s): Ondrej Certik
  • Date: 2008-06-16 22:58:01 UTC
  • mfrom: (2.1.24 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080616225801-irdhrpcwiocfbcmt
Tags: 0.6.0-12
* The description updated to match the current SciPy (Closes: #489149).
* Standards-Version bumped to 3.8.0 (no action needed)
* Build-Depends: netcdf-dev changed to libnetcdf-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
/*
 
61
Cephes Math Library Release 2.3:  June, 1995
 
62
Copyright 1984, 1987, 1989, 1995 by Stephen L. Moshier
 
63
*/
 
64
 
 
65
#include "cephes_names.h"
 
66
 
 
67
/* Constant definitions for math error conditions
 
68
 */
 
69
 
 
70
#define DOMAIN          1       /* argument domain error */
 
71
#define SING            2       /* argument singularity */
 
72
#define OVERFLOW        3       /* overflow range error */
 
73
#define UNDERFLOW       4       /* underflow range error */
 
74
#define TLOSS           5       /* total loss of precision */
 
75
#define PLOSS           6       /* partial loss of precision */
 
76
#define TOOMANY         7       /* too many iterations */
 
77
#define MAXITER        500
 
78
 
 
79
#define EDOM            33
 
80
#define ERANGE          34
 
81
 
 
82
/* Complex numeral.  */
 
83
typedef struct
 
84
        {
 
85
        double r;
 
86
        double i;
 
87
        } cmplx;
 
88
 
 
89
/* Long double complex numeral.  */
 
90
/*
 
91
typedef struct
 
92
        {
 
93
        long double r;
 
94
        long double i;
 
95
        } cmplxl;
 
96
*/
 
97
 
 
98
/* Type of computer arithmetic */
 
99
 
 
100
/* This is kind of improper, as the byte-order of floats may not
 
101
 * be the same as the byte-order of ints. However, it works.
 
102
 */
 
103
 
 
104
#include <pyconfig.h>
 
105
#ifdef WORDS_BIGENDIAN
 
106
# define MIEEE 1
 
107
# define BIGENDIAN 1
 
108
#else
 
109
# define IBMPC 1
 
110
# define BIGENDIAN 0
 
111
#endif
 
112
 
 
113
/* UNKnown arithmetic, invokes coefficients given in
 
114
 * normal decimal format.  Beware of range boundary
 
115
 * problems (MACHEP, MAXLOG, etc. in const.c) and
 
116
 * roundoff problems in pow.c:
 
117
 * (Sun SPARCstation)
 
118
 */
 
119
/* #define UNK 1 */
 
120
 
 
121
/* Define this `volatile' if your compiler thinks
 
122
 * that floating point arithmetic obeys the associative
 
123
 * and distributive laws.  It will defeat some optimizations
 
124
 * (but probably not enough of them).
 
125
 *
 
126
 * #define VOLATILE volatile
 
127
 */
 
128
#define VOLATILE
 
129
 
 
130
/* For 12-byte long doubles on an i386, pad a 16-bit short 0
 
131
 * to the end of real constants initialized by integer arrays.
 
132
 *
 
133
 * #define XPD 0,
 
134
 *
 
135
 * Otherwise, the type is 10 bytes long and XPD should be
 
136
 * defined blank (e.g., Microsoft C).
 
137
 *
 
138
 * #define XPD
 
139
 */
 
140
#define XPD 0,
 
141
 
 
142
/* Define to support tiny denormal numbers, else undefine. */
 
143
#define DENORMAL 1
 
144
 
 
145
/* Define to ask for infinity support, else undefine. */
 
146
#define INFINITIES 1
 
147
#ifdef NOINFINITIES
 
148
#undef INFINITIES
 
149
#endif
 
150
 
 
151
/* Define to ask for support of numbers that are Not-a-Number,
 
152
   else undefine.  This may automatically define INFINITIES in some files. */
 
153
#define NANS 1
 
154
#ifdef NONANS
 
155
#undef NANS
 
156
#endif
 
157
 
 
158
/* Define to distinguish between -0.0 and +0.0.  */
 
159
#define MINUSZERO 1
 
160
 
 
161
/* Define 1 for ANSI C atan2() function
 
162
   See atan.c and clog.c. */
 
163
#define ANSIC 1
 
164
 
 
165
/* Get ANSI function prototypes, if you want them. */
 
166
#if defined(__STDC__) || defined(_MSC_EXTENSIONS)
 
167
#define ANSIPROT
 
168
#include "protos.h"
 
169
#else
 
170
int mtherr();
 
171
#endif
 
172
 
 
173
/* Variable for error reporting.  See mtherr.c.  */
 
174
extern int merror;
 
175
 
 
176
#define gamma Gamma