Skip to content

Scalar lgamma_stirling and lbeta truncate log input to integer  #1704

@rok-cesnovar

Description

@rok-cesnovar

Description

https://github.com/stan-dev/math/blob/develop/stan/math/prim/fun/lbeta.hpp does not include <cmath> and does not declare using std::log anywhere. Which probably means that that would use stan::math::log. But, given that only declare stan::math::log(int) that means that the input gets truncated to integer. Luckily this doesnt effect vectorized versions and eigen versions.

We have the same issue in https://github.com/stan-dev/math/blob/develop/stan/math/prim/fun/lgamma_stirling.hpp where there is a missing using statement.

This came up when trying to fix #1692

cc: @martinmodrak I think you were having issue with these two functions in the past if I remember correctly, but cant find the thread/PR right now. Hopefully the fix of this wil help in any way.

Will fix in #1702

Current Version:

v3.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions