Closed mhollanders closed 3 months ago
Yes, this is expected. What you have written is equivalent to
real x;
real y = positive_infinity();
And Stan leaves un-initialized values as NaN
The syntax for declaring multiple variables of the same type at once does not allow initializing all of them to the same value while doing so, but you could write
real x = something(), y = something();
Thanks @WardBrian, surprisingly this issue has never caused problems before because I've been doing this for ages. Thanks, and sorry for the non-issue.
Hi,
I was working on a function where I wanted to declare multiple variables as
positive_infinity()
at the same time in a program calledinfinity.stan
:Running this yields the following confusing outcome, where only
y
isinf
butx
isnan
. Is this expected behaviour?Thanks!
Matt