Closed
Description
Environment
- Module or chip used: ESP32-PICO-D4 and ESP32C3
- IDF version: v4.4-dev-2128-gf45b60b28
- Build System: idf.py
- Compiler version: xtensa-esp32-elf-gcc (crosstool-NG esp-2021r1) 8.4.0
- Operating System: Linux
Problem Description
The return value of pow(-1, NAN)
and tgamma(-INFINITY)
are incorrect (according to standard C function semantics).
Expected Behavior
pow(-1, NAN)
should returnNAN
; see https://pubs.opengroup.org/onlinepubs/9699919799/functions/pow.htmltgamma(-INFINITY)
should returnNAN
; see https://pubs.opengroup.org/onlinepubs/9699919799/functions/tgamma.html
Actual Behavior
pow(-1, NAN)
returns-1.000
tgamma(-INFINITY)
returnsINFINITY
Steps to reproduce / code
Create a simple program (eg based on hello_world) and add these lines:
printf("pow(-1, nan) = %f\n", pow(-1, NAN));
printf("tgamma(-inf) = %f\n", tgamma(-INFINITY));
Then compile, flash, run, and inspect output.