Skip to content
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

lgamma returns NaN when given a negative integer but should return Inf #560

Closed
bgoodri opened this issue Jun 7, 2017 · 1 comment
Closed

Comments

@bgoodri
Copy link
Contributor

bgoodri commented Jun 7, 2017

Summary:

lgamma(-1) returns NaN, which is documented and what Boost does but stupid

Description:

The limit of the Gamma function as its argument approaches a non-negative integer is + / - infinity depending on whether you approach from the right or the left. The C++11 version of lgamma returns positive infinity, as does R. We should switch to the C++11 version of all these functions in cmath.

Reproducible Steps:

Evaluate lgamma at a non-positive integer

Current Output:

NaN

Expected Output:

inf

Additional Information:

Current Version:

v2.15.0

@andrjohns
Copy link
Collaborator

Closed via #1080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants