diff options
author | Travis E. Oliphant <teoliphant@gmail.com> | 2012-06-12 01:00:00 -0700 |
---|---|---|
committer | Travis E. Oliphant <teoliphant@gmail.com> | 2012-06-12 01:00:00 -0700 |
commit | cf72f825c30d4f651bd23814420c9c8f2405581d (patch) | |
tree | 621f15d2abd8328ca393fcb50729df4c767d8f83 /numpy/core | |
parent | c8beafda2251693396794a23601acf167a0e61d5 (diff) | |
parent | f2f306d55ead9a052dea0b1bc7e4a24a2e8916c8 (diff) | |
download | numpy-cf72f825c30d4f651bd23814420c9c8f2405581d.tar.gz |
Merge pull request #287 from ahmadia/patch-1
Fix dirty handling of internal compiler variable
Diffstat (limited to 'numpy/core')
-rw-r--r-- | numpy/core/src/npymath/ieee754.c.src | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/numpy/core/src/npymath/ieee754.c.src b/numpy/core/src/npymath/ieee754.c.src index 3ece2b874..90bbf5fb6 100644 --- a/numpy/core/src/npymath/ieee754.c.src +++ b/numpy/core/src/npymath/ieee754.c.src @@ -18,6 +18,13 @@ double npy_copysign(double x, double y) } #endif +/* + The below code is provided for compilers which do not yet provide C11 compatibility (gcc 4.5 and older) + */ +#ifndef LDBL_TRUE_MIN +#define LDBL_TRUE_MIN __LDBL_DENORM_MIN__ +#endif + #if !defined(HAVE_DECL_SIGNBIT) #include "_signbit.c" @@ -205,7 +212,7 @@ npy_longdouble _nextl(npy_longdouble x, int p) } if(ihx <= 0x0360000000000000LL) { /* x <= LDBL_MIN */ u = math_opt_barrier (x); - x -= __LDBL_DENORM_MIN__; + x -= LDBL_TRUE_MIN; if (ihx < 0x0360000000000000LL || (hx > 0 && (npy_int64) lx <= 0) || (hx < 0 && (npy_int64) lx > 1)) { @@ -229,14 +236,14 @@ npy_longdouble _nextl(npy_longdouble x, int p) } if(ihx <= 0x0360000000000000LL) { /* x <= LDBL_MIN */ u = math_opt_barrier (x); - x += __LDBL_DENORM_MIN__; + x += LDBL_TRUE_MIN; if (ihx < 0x0360000000000000LL || (hx > 0 && (npy_int64) lx < 0 && lx != 0x8000000000000001LL) || (hx < 0 && (npy_int64) lx >= 0)) { u = u * u; math_force_eval (u); /* raise underflow flag */ } - if (x == 0.0L) /* handle negative __LDBL_DENORM_MIN__ case */ + if (x == 0.0L) /* handle negative LDBL_TRUE_MIN case */ x = -0.0L; return x; } |