summaryrefslogtreecommitdiff
path: root/numpy/core/src/numpyos.c
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2009-03-10 13:46:55 +0000
committerDavid Cournapeau <cournape@gmail.com>2009-03-10 13:46:55 +0000
commit7c1192a8befb50e5da5feee32a55faf6d006e782 (patch)
tree6f648ffea6474277286a36c404944b8c925272e7 /numpy/core/src/numpyos.c
parent8921d5d97f769d0ae2adee65445aa0748b0e4de1 (diff)
downloadnumpy-7c1192a8befb50e5da5feee32a55faf6d006e782.tar.gz
Add macros for positive and negative inf.
Diffstat (limited to 'numpy/core/src/numpyos.c')
-rw-r--r--numpy/core/src/numpyos.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/numpy/core/src/numpyos.c b/numpy/core/src/numpyos.c
index 061b43ab0..f5337a861 100644
--- a/numpy/core/src/numpyos.c
+++ b/numpy/core/src/numpyos.c
@@ -321,10 +321,10 @@ _ASCII_FORMAT(long double, l, long double)
_ASCII_FORMAT(long double, l, double)
#endif
-
-static double NumPyOS_PINF; /* Positive infinity */
-static double NumPyOS_PZERO; /* +0 */
-static double NumPyOS_NAN; /* NaN */
+#if 0
+static double NPY_INFINITY; /* Positive infinity */
+static double NPY_PZERO; /* +0 */
+static double NPY_NAN; /* NaN */
/* NumPyOS_init:
*
@@ -345,7 +345,7 @@ NumPyOS_init(void) {
}
tmp = c;
}
- NumPyOS_PINF = c;
+ NPY_INFINITY = c;
tmp = 0;
c = div;
@@ -357,9 +357,10 @@ NumPyOS_init(void) {
tmp = c;
}
- NumPyOS_PZERO = c;
- NumPyOS_NAN = NumPyOS_PINF / NumPyOS_PINF;
+ NPY_PZERO = c;
+ NPY_NAN = NPY_INFINITY / NPY_INFINITY;
}
+#endif
/*
@@ -502,7 +503,7 @@ NumPyOS_ascii_strtod(const char *s, char** endptr)
if (endptr != NULL) {
*endptr = (char*)p;
}
- return NumPyOS_NAN;
+ return NPY_NAN;
}
else if (NumPyOS_ascii_strncasecmp(p, "inf", 3) == 0) {
p += 3;
@@ -512,7 +513,7 @@ NumPyOS_ascii_strtod(const char *s, char** endptr)
if (endptr != NULL) {
*endptr = (char*)p;
}
- return result*NumPyOS_PINF;
+ return result*NPY_INFINITY;
}
/* End of ##1 */