-
-
Notifications
You must be signed in to change notification settings - Fork 194
Allow forward_as to convert integers to doubles #3191
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
Conversation
stan/math/prim/meta/forward_as.hpp
Outdated
typename = std::enable_if_t< | ||
!std::is_same<std::decay<T_actual>, std::decay<T_desired>>::value | ||
&& !(std::is_arithmetic_v<std::decay_t< | ||
T_desired>> && std::is_arithmetic_v<std::decay_t<T_actual>>)>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be
std::is_floating_point_v<std::decay_t<
T_desired>> && std::is_integral_v<std::decay_t<T_actual>>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be more specific, I can change it
Jenkins Console Log Machine informationNo LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focalCPU: G++: Clang: |
Summary
Closes #3189.
Note that we will probably want to eventually remove this function (#3190), but for now this fixes the bug with
normal_id_glm_lpdf
.Tests
Added the reproducer from #3189 as a test
Side Effects
None?
Release notes
Checklist
Copyright holder: (fill in copyright holder information)
The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
the basic tests are passing
./runTests.py test/unit
)make test-headers
)make test-math-dependencies
)make doxygen
)make cpplint
)the code is written in idiomatic C++ and changes are documented in the doxygen
the new changes are tested