Skip to content

Non-standard behavior of tgamma() #325

Description

@Agonisia

Observed non-standard behavior when testing tgamma().
Currently, the tgamma() function implementation has an inconsistency with error handling.

Reference Link

Errors are reported as specified in math_errhandling.
For IEEE-compatible type double, overflow happens if 0 < x < 1/[DBL_MAX] or if x > 171.7.  
  
If a range error due to overflow occurs, [±HUGE_VAL], ±HUGE_VALF, or ±HUGE_VALL is returned.
POSIX requires that a pole error occurs if the argument is zero, but a domain error occurs when the argument is a negative integer

Specifically, it fails to set errno to either ERANGE (for overflow cases) or EDOM (when the input parameter is a negative integer), as required by standard.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions