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

Fix warnings in special functions #864

Merged
merged 4 commits into from
Nov 29, 2022
Merged

Conversation

mborland
Copy link
Member

No description provided.

@@ -239,7 +239,7 @@
return r;
}
int s1, s2;
T r = boost::math::lgamma(T(z + n), &s1, pol) - boost::math::lgamma(z, &s2, pol);
auto r = static_cast<T>(boost::math::lgamma(T(z + n), &s1, pol) - boost::math::lgamma(z, &s2, pol));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mborland this diff all looks good to go to me, but just for future reference, I'm curious why this one warns as the results of the lgamma calls should be T's (even in the float case)?

Copy link
Member Author

@mborland mborland Nov 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume z is an integer type so the call boost::math::lgamma(z, &s2, pol) is promoting to double. If that is a bad assumption I am not sure why, or if that was intentional.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No z is a real type.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which compiler/test case was triggering the warnings?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which compiler/test case was triggering the warnings?

Example is here using MSVC 2022 running git_issue_810 with C++20.

@mborland mborland merged commit 4e77917 into boostorg:develop Nov 29, 2022
@mborland mborland deleted the warnings branch November 29, 2022 16:42
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 this pull request may close these issues.

2 participants