-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
esp32: Workaround math.gamma(-inf) result. #15539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
esp32: Workaround math.gamma(-inf) result. #15539
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #15539 +/- ##
=======================================
Coverage 98.43% 98.43%
=======================================
Files 161 161
Lines 21281 21281
=======================================
Hits 20948 20948
Misses 333 333 ☔ View full report in Codecov by Sentry. |
Code size report:
|
This is related to espressif/esp-idf#7282, where I reported that I guess it's fine to work around the |
This is calling tgamma, so according to that issue it should be fixed... 🤔 |
ed8afe9
to
50f6881
Compare
Looks like tgammaf() wasn't fixed when tgamma() was. Have opened another ESP-IDF issue and linked it from the PR description. Suggest we merge this workaround until an upstream fix is available. |
50f6881
to
1f4019c
Compare
1f4019c
to
a8838b7
Compare
@dpgeorge Updated, verified the test still passes on ESP32. |
a8838b7
to
cdc3e4f
Compare
@projectgus for a change like this, ideally it would be split into two commits, one for the new option added to modmath.c, and a second for the esp32 port to enable this option to work around the bug; eg the first commit would have a message like Can you please split the commit that way? |
cdc3e4f
to
ce57eb3
Compare
@dpgeorge Sure, have split and re-ran float tests on unix port and esp32 port. |
This is needed for a workaround on esp32 port (in child commit), which produces incorrect results otherwise. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <[email protected]>
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 <[email protected]>
ce57eb3
to
6fead31
Compare
Summary
Without this workaround,
math.gamma(-float("inf"))
returns inf instead of raising a math domain ValueError.Found while testing #15523.
Upstream issue reported as espressif/esp-idf#14273
Testing
tests/float/math_domain_special.py fails on esp32 without this fix.
This work was funded through GitHub Sponsors.