diff options
Diffstat (limited to 'numpy/core/src')
| -rw-r--r-- | numpy/core/src/npymath/npy_math_complex.c.src | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/numpy/core/src/npymath/npy_math_complex.c.src b/numpy/core/src/npymath/npy_math_complex.c.src index fb31e8e6a..ea784ec5b 100644 --- a/numpy/core/src/npymath/npy_math_complex.c.src +++ b/numpy/core/src/npymath/npy_math_complex.c.src @@ -35,11 +35,17 @@ #include "npy_math_private.h" #include <numpy/utils.h> - -#define raise_inexact() do { volatile npy_float junk = 1 + tiny; } while(0) +/* + * Hack inherited from BSD, the intent is to set the FPU inexact + * flag in an efficient way. The flag is IEEE specific. See + * https://github.com/freebsd/freebsd/blob/4c6378299/lib/msun/src/catrig.c#L42 + */ +#define raise_inexact() do { \ + volatile npy_float NPY_UNUSED(junk) = 1 + tiny; \ +} while (0) -static __COMP_NPY_UNUSED npy_float tiny = 3.9443045e-31f; +static const volatile npy_float tiny = 3.9443045e-31f; /**begin repeat |
