summaryrefslogtreecommitdiff
path: root/py/mpconfig.h
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2020-09-08 15:22:34 +0200
committerDamien George <damien@micropython.org>2020-09-11 10:04:57 +1000
commit2e54d9d146b34d7ad00e4394c9767f4319244cdf (patch)
treeb6d56e3d53b9fef5d5898964d7bdd086e23016d5 /py/mpconfig.h
parent8d5a40c86e384bf3cddb2f687374e0bb1ae6df7d (diff)
py: Fix handling of NaN in certain pow implementations.
Adds a new compile-time option MICROPY_PY_MATH_POW_FIX_NAN for use with toolchains that don't handle pow-of-NaN correctly.
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r--py/mpconfig.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index ae4cabfdc..12517316c 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -1160,6 +1160,11 @@ typedef double mp_float_t;
#define MICROPY_PY_MATH_MODF_FIX_NEGZERO (0)
#endif
+// Whether to provide fix for pow(1, NaN) and pow(NaN, 0), which both should be 1 not NaN.
+#ifndef MICROPY_PY_MATH_POW_FIX_NAN
+#define MICROPY_PY_MATH_POW_FIX_NAN (0)
+#endif
+
// Whether to provide "cmath" module
#ifndef MICROPY_PY_CMATH
#define MICROPY_PY_CMATH (0)