Skip to content

Incorrect return values for pow(-1,nan) and tgamma(-inf) (IDFGH-5559) #7282

Closed
@dpgeorge

Description

@dpgeorge

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

Actual Behavior

  • pow(-1, NAN) returns -1.000
  • tgamma(-INFINITY) returns INFINITY

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions