Skip to content

[libc] Correct edge cases, errno, and floating point exceptions for math functions #61092

Closed
@lntue

Description

@lntue

There are many cases of math functions not returning correct errno and floating point exceptions according to the C standard. The following cases are reported by Fred J. Tydeman:

  • log(1) = -0 for FE_DOWNWARD
  • logb(0) is not raising divide-by-zero
  • sqrt(-infinity) => missing errno == EDOM
  • fmod(-NAN,-NAN) = +NAN
  • remainder(-infinity, -infinity) => no invalid
  • nextafter(-max, -infinity) => no overflow, no inexact
  • fdim(-inf, -inf) => invalid (should be no FP exception)
  • fdim(-max, -den) => inexact (should be no FP exception)
  • fma( -min, +min, +min ) => missing underflow
  • asinf() issue: no inexact

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions