summaryrefslogtreecommitdiffstatshomepage
path: root/py/mpconfig.h
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2019-07-02 10:28:44 +0200
committerDamien George <damien.p.george@gmail.com>2019-08-17 23:23:17 +1000
commitaf5c998f37ddc62abfd36e0b8be511c392fc25d8 (patch)
tree3cdabcc1b382ee0f1ce87a5ad1cabd8c96b2fa8b /py/mpconfig.h
parent3eff81288cb494c7d1a9fcf0a82d4e21bbd92dd8 (diff)
downloadmicropython-af5c998f37ddc62abfd36e0b8be511c392fc25d8.tar.gz
micropython-af5c998f37ddc62abfd36e0b8be511c392fc25d8.zip
py/modmath: Implement math.isclose() for non-complex numbers.
As per PEP 485, this function appeared in for Python 3.5. Configured via MICROPY_PY_MATH_ISCLOSE which is disabled by default, but enabled for the ports which already have MICROPY_PY_MATH_SPECIAL_FUNCTIONS enabled.
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 bded9da9fc..a21a6c7075 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -1079,6 +1079,11 @@ typedef double mp_float_t;
#define MICROPY_PY_MATH_FACTORIAL (0)
#endif
+// Whether to provide math.isclose function
+#ifndef MICROPY_PY_MATH_ISCLOSE
+#define MICROPY_PY_MATH_ISCLOSE (0)
+#endif
+
// Whether to provide "cmath" module
#ifndef MICROPY_PY_CMATH
#define MICROPY_PY_CMATH (0)