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

return type of lstirling_asym(x::Float32) is inconsistent. #140

Closed
dmbates opened this issue Apr 2, 2022 · 0 comments · Fixed by #141
Closed

return type of lstirling_asym(x::Float32) is inconsistent. #140

dmbates opened this issue Apr 2, 2022 · 0 comments · Fixed by #141

Comments

@dmbates
Copy link
Contributor

dmbates commented Apr 2, 2022

At present the return type for x <= 40 is Float64 whereas for x > 40 it is Float32.

julia> StatsFuns.lstirling_asym(21.f0)
0.00396795421864086

julia> StatsFuns.lstirling_asym(41.f0)
0.00203248f0

I believe that the definition of lstirlingF32 should be changed to

const lstirlingF32 = Float32[lstirling_asym(k) for k in big(1):big(40)]

for consistency.

dmbates added a commit that referenced this issue Apr 2, 2022
andreasnoack pushed a commit that referenced this issue Apr 3, 2022
* Consistent return type from `lstirling_asym(x::Float32)`

As described in #140

* Avoid broadcasting

Co-authored-by: David Widmann <devmotion@users.noreply.github.com>

* Add tests

* Add newline

Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
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

Successfully merging a pull request may close this issue.

1 participant