summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngus Gratton <angus@redyak.com.au>2024-07-25 12:11:32 +1000
committerDamien George <damien@micropython.org>2024-08-07 14:10:46 +1000
commit6fead318322bb21e30fdcbdccf343e02dc51990f (patch)
treefad79132a5a695b20ac8a466f1e1724664383918
parentb0c89377d0f0a4624577da8ca956f7c33d6b1882 (diff)
esp32: Enable workaround for math.gamma(-inf) result.
Without this commit, math.gamma(-float("inf")) returns inf instead of raising a math domain ValueError. Needed for float/math_domain_special.py test to pass on esp32. Root cause is an upstream libm bug, has been reported to ESP-IDF. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
-rw-r--r--ports/esp32/mpconfigport.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/ports/esp32/mpconfigport.h b/ports/esp32/mpconfigport.h
index b9e53a4fa..3349e56e4 100644
--- a/ports/esp32/mpconfigport.h
+++ b/ports/esp32/mpconfigport.h
@@ -282,6 +282,10 @@ typedef long mp_off_t;
#define MICROPY_PY_MACHINE_BOOTLOADER (0)
#endif
+// Workaround for upstream bug https://github.com/espressif/esp-idf/issues/14273
+// Can be removed if a fix is available in supported ESP-IDF versions.
+#define MICROPY_PY_MATH_GAMMA_FIX_NEGINF (1)
+
#ifndef MICROPY_BOARD_STARTUP
#define MICROPY_BOARD_STARTUP boardctrl_startup
#endif