aboutsummaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorstijn2019-07-02 10:28:44 +0200
committerDamien George2019-08-17 23:23:17 +1000
commitaf5c998f37ddc62abfd36e0b8be511c392fc25d8 (patch)
tree3cdabcc1b382ee0f1ce87a5ad1cabd8c96b2fa8b /ports
parent3eff81288cb494c7d1a9fcf0a82d4e21bbd92dd8 (diff)
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 'ports')
-rw-r--r--ports/esp32/mpconfigport.h1
-rw-r--r--ports/javascript/mpconfigport.h1
-rw-r--r--ports/stm32/mpconfigport.h1
-rw-r--r--ports/unix/mpconfigport.h1
-rw-r--r--ports/windows/mpconfigport.h1
5 files changed, 5 insertions, 0 deletions
diff --git a/ports/esp32/mpconfigport.h b/ports/esp32/mpconfigport.h
index 364b2de5c..cba319245 100644
--- a/ports/esp32/mpconfigport.h
+++ b/ports/esp32/mpconfigport.h
@@ -98,6 +98,7 @@
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1)
#define MICROPY_PY_MATH (1)
#define MICROPY_PY_MATH_SPECIAL_FUNCTIONS (1)
+#define MICROPY_PY_MATH_ISCLOSE (1)
#define MICROPY_PY_CMATH (1)
#define MICROPY_PY_GC (1)
#define MICROPY_PY_IO (1)
diff --git a/ports/javascript/mpconfigport.h b/ports/javascript/mpconfigport.h
index 228113c48..02d83f402 100644
--- a/ports/javascript/mpconfigport.h
+++ b/ports/javascript/mpconfigport.h
@@ -73,6 +73,7 @@
#define MICROPY_PY_COLLECTIONS (1)
#define MICROPY_PY_MATH (1)
#define MICROPY_PY_MATH_SPECIAL_FUNCTIONS (1)
+#define MICROPY_PY_MATH_ISCLOSE (1)
#define MICROPY_PY_CMATH (1)
#define MICROPY_PY_IO (1)
#define MICROPY_PY_STRUCT (1)
diff --git a/ports/stm32/mpconfigport.h b/ports/stm32/mpconfigport.h
index dbb6fa2d5..5eb44bd46 100644
--- a/ports/stm32/mpconfigport.h
+++ b/ports/stm32/mpconfigport.h
@@ -114,6 +114,7 @@
#define MICROPY_PY_COLLECTIONS_DEQUE (1)
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1)
#define MICROPY_PY_MATH_SPECIAL_FUNCTIONS (1)
+#define MICROPY_PY_MATH_ISCLOSE (1)
#define MICROPY_PY_MATH_FACTORIAL (1)
#define MICROPY_PY_CMATH (1)
#define MICROPY_PY_IO (1)
diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h
index 123cad2bc..23c562e5a 100644
--- a/ports/unix/mpconfigport.h
+++ b/ports/unix/mpconfigport.h
@@ -104,6 +104,7 @@
#ifndef MICROPY_PY_MATH_SPECIAL_FUNCTIONS
#define MICROPY_PY_MATH_SPECIAL_FUNCTIONS (1)
#endif
+#define MICROPY_PY_MATH_ISCLOSE (MICROPY_PY_MATH_SPECIAL_FUNCTIONS)
#define MICROPY_PY_CMATH (1)
#define MICROPY_PY_IO_IOBASE (1)
#define MICROPY_PY_IO_FILEIO (1)
diff --git a/ports/windows/mpconfigport.h b/ports/windows/mpconfigport.h
index ffe7ae144..1a9842609 100644
--- a/ports/windows/mpconfigport.h
+++ b/ports/windows/mpconfigport.h
@@ -86,6 +86,7 @@
#define MICROPY_PY_COLLECTIONS_DEQUE (1)
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1)
#define MICROPY_PY_MATH_SPECIAL_FUNCTIONS (1)
+#define MICROPY_PY_MATH_ISCLOSE (1)
#define MICROPY_PY_CMATH (1)
#define MICROPY_PY_IO_FILEIO (1)
#define MICROPY_PY_GC_COLLECT_RETVAL (1)