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

gamma(0) returns the wrong value. #411

Open
oscardssmith opened this issue Oct 25, 2022 · 1 comment
Open

gamma(0) returns the wrong value. #411

oscardssmith opened this issue Oct 25, 2022 · 1 comment

Comments

@oscardssmith
Copy link
Member

This issue is the opposite issue of #163. Currently gamma(0.0) returns Inf as does gamma(0.0+0.0im), and gamma(0.0-0.0im) This isn't the correct limit because

gamma(0. + 1e-16im)
0.6123233995736787 - 1.0000000000000034e16im

and

julia> gamma(0.0-1e-16im)
0.6123233995736787 + 1.0000000000000034e16im

which really makes it seem like gamma of complex 0s should return an appropriate complex infinity and gamma(0.0) should error.

@stevengj
Copy link
Member

stevengj commented Oct 25, 2022

Usually for real arguments we take the limit along the real line, with the sign of zero determining the direction of the limit:

julia> gamma(1e-16)
1.0e16

julia> gamma(0.0)
Inf

julia> gamma(-1e-16)
-1.0e16

julia> gamma(-0.0)
-Inf

For a complex 0 possibly we should throw since the limit depends on the angle at which you approach zero?

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